Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

Array Instance Variables
We know that Array is a type of object. its also declared but not explicitly initialised for the value of Null.just as other object reference instance variable.HEre most imp line is " Array elements are always always always given default values, regardless of where the array itself is declared or instantiated".
         When we would like to initialise an array and that time object reference elements value is equal to null.
public class BirthDays {
static int [] year = new int[100];
public static void main(String [] args) {
for(int i=0;i<100;i++)
System.out.println("year[" + i + "] = " + year[i]);
}
}
Posted By: Name:Rajesh Kr URL: Array Instance Variables