"Right, so first thing: where are the calls to the getters? Surely they are implicitly called, but how? I don't see anywhere."
The class Employee was written with getters and setters, but the author didn't use the getters. The variables "private String name" and "private String jobTitle" have the scope of this method only. Because the main method calls another method within that class, they are able to use these variables.
"And don't we need a third setter and getter for the thrid variable, the money?"
Good programming practice would call for a seperate method for getting and setting the money variable. You should always strive for readablity in your code. The line below looks for the next number with a decimal point in it and records it as the money amount and passes it in as a parameter for the method.
thanks for the comments guys, really helps. One more question though: if the getters are not used, what's the point of having them in the program? I appreciate it's good programming practice, but they are just a waste of code if not used aren't they?
That is the whole program today, but you don't know about tomorrow or who will be using it. One of the biggest mistakes a programmer can make is to assume that their sloppy code won't be used years from now. We are still using some code that was written in the 50's and 60's! Remember Y2K? People said that by the time 2000 rolls around, we won't still be using this code. It may work fine today, that dosen't mean it will work forever. It never hurts to write simple code that you can file away for years and then go back to and dust off and understand with out having to open up a programming book to know what it is doing.
I'd agree with you T-Dogg3030 if it was a big big piece of code, but what's the point of doing that in such a small program? I thought he did it becasue it was actually doing something, but it isn't really
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.