Take the 2-minute tour ×

Say I got an Employee class that has a hire date data member. This member only get set one time only and it is constant too. So it'll get initialised when the object is created.

If I want the class to have a method that returns the hire date, what's better:


Or just:


Am I thinking too much :D ?

share|improve this question
The conventions will vary depending on what language/framework you're using. I'm guessing Java, in which case I would personally go for getHireDate(). –  LukeH Oct 19 '10 at 10:43

1 Answer 1

up vote 1 down vote accepted



is fine. It doesn't need a 'set' method to be proper OO.

Edit: if you haven't yet, read some Java Coding Style docs... they're simple enough, and standard coding conventions make everybody' life easier. I just found this: Java Programming Style Guidelines. Good reading.

share|improve this answer

Your Answer


