// // Test array import java.util.Scanner; class TestArray { public static void main(String[] args) { Scanner input = new Scanner(System.in); int[] a = {12, 7, 17, 21}; // chage the first one to 3? a[0] = 3; // output the last one to monitor? System.out.println(a[3]); // out all? for(int i=0; i<4; i++) System.out.println(a[i]); int[] ages = new int[1000]; // let the first stu be 18? ages[0] = 18; // let the 20th stu be 42? ages[19] = 42; // read the first 4 students' ages from key.? for(int i=0; i<4; i++) ages[i] = input.nextInt(); for(int i=0; i<4; i++) System.out.println(ages[i]); } }