File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Setter/Getter method issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Setter/Getter method issues" Watch "Setter/Getter method issues" New topic

Setter/Getter method issues

Justin Bodin

Joined: Oct 21, 2009
Posts: 15
So another question. This is my first time trying to user setter/getter methods and cannot figure out why I am getting "cannot find symbol" each time I try to use the set or get method from another class.
I don't know if it's a small error I am missing or an entire concept I am not grasping. I will paste the code. The program is supposed to get name, weekly pay, and weekly hours worked from user and store that info in the methods in "Payroll1" That file is compiling fine, but my is giving the errors I explained.

Thanks for any help you all can offer me.

The output will not be working correctly yet, as I am trying to figure that out as well.

Thanks again
Janeice DelVecchio
Saloon Keeper

Joined: Sep 14, 2009
Posts: 1789

I compiled fine. Try putting it in a directory together and using the command:

Edit: I also ran it, it seems to work okay so far. Good job!

The compiler needs to be able to "find" all the methods called at compile-time.... I'm pretty sure. That's why it won't compile separately.

When you do things right, people won't be sure you've done anything at all.
Sachin Joshi
Ranch Hand

Joined: Aug 06, 2008
Posts: 83

Also it will be good to keep the current directory in CLASSPATH. you can add it like



Web Development Tips and Tutorials - By Sachin
Justin Bodin

Joined: Oct 21, 2009
Posts: 15
Thanks for the prompt replies guys, I really appreciate it.

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46397
If you need to do anything with your CLASSPATH, it might be because your system CLASSPATH has previously been set incorrectly. It is usually unnecessary to do anything with your system CLASSPATH
I agree. Here's the link:
subject: Setter/Getter method issues
It's not a secret anymore!