This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Using the Dog Class and Its Methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Using the Dog Class and Its Methods" Watch "Using the Dog Class and Its Methods" New topic
Author

Using the Dog Class and Its Methods

Abid Ramay
Ranch Hand

Joined: Apr 06, 2013
Posts: 43
hi there .. i've a question -




i am getting an error when i run this program --

C:\xxx\xx\xxx>javac c:\workspaces\Dog\Dog*.java
c:\xxx\xxx\Dog.java:5: error: cannot find symbol
string name;
^
symbol: class string
location: class Dog
c:\workspaces\Dog\Dog.java:6: error: cannot find symbol
string breed;

------------

if i hide // string name ; and other variables , it runs fine --
C:\xxx\Dog>java DogDemo
Age6
----------------

any ideas on whats going on ?!!
Stuart A. Burkett
Ranch Hand

Joined: May 30, 2012
Posts: 679
Java is case sensitive. There is no string class in ths standard API.
Abid Ramay
Ranch Hand

Joined: Apr 06, 2013
Posts: 43
Stuart A. Burkett wrote:Java is case sensitive. There is no string class in ths standard API.


thanks for your help .. now i've different error ..

c:\workspaces\Dog\DogDemo.java:9: error: cannot find symbol
Dog d1 = new Dog();
^
symbol: class Dog
location: class DogDemo
c:\workspaces\Dog\DogDemo.java:9: error: cannot find symbol
Dog d1 = new Dog();
^
symbol: class Dog
location: class DogDemo
c:\workspaces\Dog\DogDemo.java:11: error: cannot find symbol
d1.name = denver;
^


vicky garg
Greenhorn

Joined: Apr 27, 2013
Posts: 1
java is case sensitive.
try using String(with capital S).
String is pre-defined class in java.
and also use " " while initializing a string like
String name = "john";
Abid Ramay
Ranch Hand

Joined: Apr 06, 2013
Posts: 43
vicky garg wrote:java is case sensitive.
try using String(with capital S).
String is pre-defined class in java.
and also use " " while initializing a string like
String name = "john";


hi there .. i am still getting one error where it intially started.

c:\workspaces\Dog\DogDemo.java:9: error: cannot find symbol
Dog d1 = new Dog();
^
symbol: class Dog
location: class DogDemo
c:\workspaces\Dog\DogDemo.java:9: error: cannot find symbol
Dog d1 = new Dog();
^
symbol: class Dog
location: class DogDemo
2 errors
Abid Ramay
Ranch Hand

Joined: Apr 06, 2013
Posts: 43
hi there

thanks for your help .. got it now ..

C:\Workspaces\Dog>java DogDemo
Namedenver
Age6
breedsheperd
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using the Dog Class and Its Methods
 
Similar Threads
Package Problem
Problem with System.out.print
Class dog problems
Hi, package compiling question...