Jump to content

Talk:Final (Java)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Thejoshwolfe (talk | contribs) at 07:53, 21 November 2008 (Final Local Variables and Arguments). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

This page was all wrong about final variables.

First, they are not like "const" in C++ since in that language a const field is limited not only to not being reassigned, but there is the additional limitation that only const methods can called on it and it can only be passed as the const argument of other methods.

Second, (non-static) inner classes can freely access any field of the enclosing class, final or not.


Final Local Variables and Arguments

Arguments and local variables can also be declared final. I'm not entirely sure how it works, but I think it should be included in this article.

Thejoshwolfe (talk) 07:53, 21 November 2008 (UTC)[reply]