import java.util.Scanner; public class eg02array { public static void main(String[] args) { int[] days = {31, 28, 31}; //another way to declare array // days[4]=30; //this one gives out of bound error at run time for (int index = 0; index < 3; index++) { System.out.println(days[index]); } } }