Method "cutCheck" is printing the values of instance variables.
That's what is being displayed in the output when you run the code
out.printf("Pay to the order of %s ", name);
out.printf("(%s) ***$", jobTitle);
out.printf("%,.2f\n", amountPaid);
These variables "name, jobtitle, amountPaid" are all instance varaibles, so they can be direclty accessed in any instance method of the same class without using getter methods.
subramanya.vl
Junior Poster in Training
81 posts since Oct 2012
Reputation Points: 0
Solved Threads: 10
Skill Endorsements: 1
Thta's not a whole program, it's just one class. That class will be combined with other classes to make a useful program. The other classes will then use the getters to access the Employee info.
JamesCherrill
... trying to help
8,512 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,455
Skill Endorsements: 30
Remember that this code is just one tiny training exercise. In real life there's no such thing as a program as small and useless as this one. In real life the use of getters and setters is an essential part of Java OO programming technique, and it's never too early to start learning and practising their use.
JamesCherrill
... trying to help
8,512 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,455
Skill Endorsements: 30
Question Answered as of 5 Months Ago by
T-Dogg3030,
JamesCherrill
and
subramanya.vl