File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Setter/Getter method issues" Watch "Setter/Getter method issues" New topic
Author

Setter/Getter method issues

Justin Bodin
Greenhorn

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 EmpInfo.java is giving the errors I explained.

Thanks for any help you all can offer me.

Payroll1.java


EmpInfo.java


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: 1732
    
  12

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

Windows:



Linux:



Web Development Tips and Tutorials - By Sachin
Justin Bodin
Greenhorn

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

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40029
    
  28
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: http://aspose.com/file-tools
 
subject: Setter/Getter method issues