Matthew Brown wrote:It should return "int", but the method also should be marked as static. When you see a method declared as "static int", only the "int" part is the return type. The "static" means that you don't need to create an instance of the class to call the method.
Oh i see. But then why is it not common practice to declare all getters static?
Campbell Ritchie wrote:Some people say there should be no such thing as a static variable at all in an object language.
@Chris: The problem is not with a static getter; it's with the idea of a static variable - which suggests a "setter" as well.
My advice: Don't do it.