• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setter/Getter method issues

 
Justin Bodin
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1809
12
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sachin Joshi
Ranch Hand
Posts: 83
Java Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also it will be good to keep the current directory in CLASSPATH. you can add it like

Windows:



Linux:

 
Justin Bodin
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the prompt replies guys, I really appreciate it.

 
Campbell Ritchie
Sheriff
Pie
Posts: 49823
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic