| Author |
Instance Variable Initail Values
|
Jenny Jha
Greenhorn
Joined: Feb 23, 2008
Posts: 1
|
|
Hi All, as we know in Java all the instance variable are initialized to there default values and so on... Now we can see at many places instance variable being given some default values for e.g. protected Object myObject = null; Now my question is the above mentioned way of programming is a good programming practice or it has some other meaning too. Thanks Jenny
|
 |
Roger Chung-Wee
Ranch Hand
Joined: Sep 29, 2002
Posts: 1683
|
|
|
As not all programmers can remember the default values, then explicitly assigning values makes the code easier to read.
|
SCJP 1.4, SCWCD 1.3, SCBCD 1.3
|
 |
 |
|
|
subject: Instance Variable Initail Values
|
|
|