Originally posted by As Angel: I find that the inner class's instance variable can't be autoinitialized...
Welcome to JavaRanch!
An instance variable of an inner class should get the same default value (binary zero) as a top-level class. Can you post some code demonstrating what you mean?
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org
sandeep atluri
Ranch Hand
Joined: Apr 19, 2007
Posts: 42
posted
0
hi As Angel....
a class is an abstract model of a set or a group of things, having a basic set of qualities or properties....
you create instances of objects using the constructors provided by the class.
now... any such class, if it has another class declared inside its signature... then the class declared inside is called the Inside class or the Inner class. i.e., any class that is declared inside the curly braces of a previously declared class, is called the inner class to the outer class...
if you declare any new class outside the curly braces of an old class, then the class is not an inner class to the old class... but if you declare this new class as...
then the newClass is a subclass of the oldClass... not an inner class of the oldClass....
now ....
about instance variable's........
instance variable's belong to the Object created using the operator....
Instance variables are given default values..... irrespective of where its parent class has been declared....
the point is that they will always be auto initialized....