// // p.61 Arrays // import java.util.Scanner; public class TestArrays { public static void main(String[] args) { Scanner input = new Scanner(System.in); int [] myArray = new int[20]; String[] youArr = new String[30]; // set the first integer to 12? myArray[0] = 12; // set the second string to "VWC"? youArr[1] = "VWC"; // set the last integer to 100? myArray[19] = 100; // set the third integer as the sum of first one and the last one? myArray[2] = myArray[0] + myArray[19]; // out the third integer to the monitor? System.out.println("The third integer = " + myArray[2]); // out the second string to the monitor? System.out.println("The 2nd string = " + youArr[1]); // input the 1st string from the keyboard? System.out.print("Input the 1st string: "); youArr[0] = input.nextLine(); System.out.println("The 1st string = " + youArr[0]); for(int i=0; i<20; i++) myArray[i] = 0; // out all the integers to the monitor? for(int i=0; i<20; i++) System.out.print(myArray[i] + " "); System.out.println("\n\n\nDone.\n\n"); } }