Re: How do java programmers cope with java missing c++ const?
- From: Thomas Hawtin <usenet@xxxxxxxxxxxxxxxxx>
- Date: Tue, 28 Feb 2006 18:38:28 +0000
Michael Redlich wrote:
* A field (class or instance) that is declared 'final' cannot be
modified and must be initialized at the point of declaration.
That's not true, or even normal for instance fields.
Final instance fields must be definitely assigned (see the whole chapter on definite assignment in the JLS) in every constructor (where each constructor includes any initialisers). Local final variables are much the same (only they don't have to be assigned if unused and can't be seen by devious means before initialisation).
Tom Hawtin
--
Unemployed English Java programmer
http://jroller.com/page/tackline/
.
- References:
- How do java programmers cope with java missing c++ const?
- From: josh . s17
- Re: How do java programmers cope with java missing c++ const?
- From: Michael Redlich
- How do java programmers cope with java missing c++ const?
- Prev by Date: Re: Java Data Mapper
- Next by Date: Re: Which exception idiom do you prefer?
- Previous by thread: Re: How do java programmers cope with java missing c++ const?
- Next by thread: Re: How do java programmers cope with java missing c++ const?
- Index(es):
Relevant Pages
|