U
Ulf Nordlund
It is possible to declare a method as "private final", but would you
ever actually do that?
/ulf
ever actually do that?
/ulf
It is possible to declare a method as "private final", but would you
ever actually do that?
Stefan Schulz said:With methods this combination makes little sense, yes. I do, however,
rather frequently use private final fields. Forbidding it for methods
has no real gain, however.
--
In pioneer days they used oxen for heavy pulling, and when one ox
couldn't budge a log, they didn't try to grow a larger ox. We shouldn't
be trying for bigger computers, but for more systems of computers.
--- Rear Admiral Grace Murray Hopper
Stefan Schulz said:With methods this combination makes little sense, yes. I do, however,
rather frequently use private final fields. Forbidding it for methods
has no real gain, however.
It is possible to declare a method as "private final", but would you
ever actually do that?
/ulf
I use this frequently for Log4J Logging categories.Mike said:One could argue that private methods are implictly final, just as interface
methods are implictly public and abstract. In both cases, there's no need
to put in the implicit qualifier but no real harm in it either.
Jon Caldwell said:I use this frequently for Log4J Logging categories.
I'm sorry, I don't know what "this" refers to.
Mike Schilling said:One could argue that private methods are implictly final, just as interface
methods are implictly public and abstract. In both cases, there's no need
to put in the implicit qualifier but no real harm in it either.
It's an English demonstrative pronoun, first person, singular. It
means "the thing I am talking about". In Java, it's a keyword that
acts as a reference to the current object.
Whoops, sorry. That wasn't what you meant, was it? =)
Tony Morris said:A reflective lookup of an interface method reveals that it is indeed
abstract and public - the same cannot be said for a private method being
final.
Joona said:It's an English demonstrative pronoun, first person, singular. It
means "the thing I am talking about". In Java, it's a keyword that
acts as a reference to the current object.
Whoops, sorry. That wasn't what you meant, was it? =)
He asked what "this" refers to, not what "this" is.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.