Array of Objects
An array is a contiguous block of memory. In this program An array of objects is created of a pre-defined class.
/*
http://www.ProbCOMP.com
An array is a contiguous block of memory. In this program An array of objects is created of a pre-defined class.
*/
public class ArrayObjects{
public static void main(String args[])
{
Integer[] array = {
new Integer(1),
new Integer(2),
new Integer(3),
new Integer(4)
};
for(int i=0;i<4;i++)
System.out.println(array[i]);
}
}
Download Program


