Hi all, 1) I believe a member variable ( say int) that is declared as final has to be initialized in a initializer block or a constructor. Is that right?
2) Can i do the same with a member variable declared as static final ? This must be pretty common, but i am kinda confused abt it ...please comment on it. Thanks in advance
SCJP 1.4<br />" Somedays ur the dog...other days ur the water hydrant "
posted 12 years ago
Hi Vinay A non-static final member variable has to be intialized at the place it is declared or in a constructor or a nonstatic intializer. In case of a static final intializer the variable has to be intialized at the place it is declared or in a static intializer. Hope this thread helps you.