• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Setter/Getter method issues

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 1849
15
Eclipse IDE Spring VI Editor Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 83
Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the prompt replies guys, I really appreciate it.

 
Marshal
Posts: 79231
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
I like tacos! And this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic