|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
SCJP 6, SCWCD 5, SCBCD 5
I know about static free floating blocks in java, But here?
SCJP 6, SCWCD 5, SCBCD 5
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
SCJP 6, SCWCD 5, SCBCD 5
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
Priety.
Paul Clapham wrote:I don't remember whether they are called before or after the constructors run
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
SCJP 1.6 96%
SCJP 6, SCWCD 5, SCBCD 5
SCJP 1.6 96%
Thanks & Regards
Sidharth Pallai
Yes, they did: well doneSidharth Pallai wrote:Very Interesitng!!.
Lee and Paul made "instance initializer" understood with better instances.
So would I Anything an instance initialiser can do, a constructor or a factory method can do too. You can put all your initialisations into constructors and factory methods and never need an instance initialiser block.Anyway i would like to know , when & where "instance initializer" could be made useful.
Thanks & Regards
Sidharth Pallai
Sidharth Pallai wrote:Its sounds goog CampBell.
Thanks & Regards
Sidharth Pallai
A gottle of geer will sort that outSidharth Pallai wrote:
Sidharth Pallai wrote:Its sounds goog CampBell.
good was key'd incorrectly as goog. Sorry
Thanks & Regards
Sidharth Pallai
Campbell Ritchie wrote:
So would I Anything an instance initialiser can do, a constructor or a factory method can do too. You can put all your initialisations into constructors and factory methods and never need an instance initialiser block.
Static initialisers are probably much more useful, however.
Sidharth Pallai wrote:
But there could be some reason they have been incorporated in to JAVA. I think as we cannot talk to the block with arguments as we could do with constructors or methods.
SCJP 6, SCWCD 5, SCBCD 5
Don't count your weasels before they've popped. And now for a mulberry bush related tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|