We use cookies to collect and analyze information on site performance and usage,
to provide social media features and to enhance and customize content and advertisements.
public class InitStaticArray {
static Integer[] integerArray;
static {
integerArray= new Integer[] {
new Integer(1),
new Integer(2),
new Integer(3),
new Integer(4),
};
}
public static void main(String args[]) {
for (int i=0; i < integerArray.length; i++){
System.out.println(integerArray[i]);
}
}
}