views:

24

answers:

1

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:

getHireDate();

Or just:

hireDate();

Am I thinking too much :D ?

+1  A: 

Just

getHireDate();

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.

mdrg