This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Hi all,
i am getting an error in this code posted. can any one help me ?
next file class name
Error:
[clrg@localhost check]$ javac Main.java
./AnotherClass.java:5: cannot find symbol
symbol : class User
location: class AnotherClass
public User updateUser(User u)
^
./AnotherClass.java:5: cannot find symbol
symbol : class User
location: class AnotherClass
public User updateUser(User u)
^
Main.java:8: cannot find symbol
symbol : class User
location: class Main
User myUser = new User();
^
Main.java:8: cannot find symbol
symbol : class User
location: class Main
User myUser = new User();
^
4 errors
What am i missing here and why i am getting this error ? Help me . why it is telling it cannot find the symbol?
The code in that example wasn't complete, because it doesn't show the User class.
User is not the object name in your code. The name is myUser, which is of class User. Since User isn't a built in class, you have to provide it yourself. For that code to work, you need to have a User class with methods getName() and setName(String name).
raj warke
Greenhorn
Joined: Jan 22, 2001
Posts: 11
posted
0
Follow the steps mentioned below -
STEP 1 :- Put below files in a folder 'xyz' -
1. Main.java
2. AnotherClass.java
3. User.java
STEP 2 :- Set path variable to -
";drivename:\full_directory_of_xyz_folder\xyz"
raj warke wrote:
STEP 2 :- Set path variable to -
";drivename:\full_directory_of_xyz_folder\xyz"
Now you can run the program.
Why does he have to set the path variable? The OS can clearly already find the javac.exe program, and one would assume java.exe as well. Neither of those programs reside in the xyz directory (at least, I hope they don't).
I fail to see what this part has to do with anything.
FURTHER, if you set your PATH to ";drivename:\full_directory_of_xyz_folder\xyz", then you will probably break a LOT of other stuff, since the OS won't be able to run things that have been taken OUT of the PATH.