If I understand you correctly here you are making a distinction between static and non-static variables. Am I right? Any class variables whether static or non-static(instance) are guaranteed to be initialized. Only the variables that are defined locally to a method are the ones which are not provided a default initial value.
Java does this to make sure that the variables are properly initialized before you get your hands onto any variable. That is why you don't see strings in int which was the case with earlier programming language like c and cobol.
Originally posted by srinivas bolloju:
i know class(member) variables are initialized to a initial value but not instance variables,....but why..?
can anybody pls explain the reason behind this.