Does it have to be an array of integers? You could create an array of Strings instead, and use a letter instead of null:
Code:
public static void main(String[] args){
String[] number = new String[5];
//give initial values to array:
for(int i=0; i<5; i++){
number[i] = "e";
}
//add whatever numbers you want, in the form of a string:
number[0]="2";
number[2]="3";
//then do testing loop:
for(int j=0; j<5; j++){
if(number[j].equals("e")){
System.out.println("null");
}
else
System.out.println(number[j]);
}
}
/*
* Output:
* 2
* null
* 3
* null
* null
*/
And of course, when you need to use a number for whatever operation, just parse it to integer.
Also, you would have to take care of invalid inputs.