// This code sets things up for a general java program with input import java.util.Scanner; public class Arrayex { public static void main(String[] args) { Scanner scan = new Scanner(System.in); // done with setup, main code starts here // an array of Strings, length 3 String [] words = new String[3]; words[0] = "first word"; words[1] = "hello"; words[2] = "world"; // an array of ints, length 10 int [] intlist = new int [10]; intlist[0] = 14; intlist[3] = 99; // an array of doubles, length 5 double[] dublist = new double[5]; // all zeroes now // special initialization double[] prices = new double[] {3.99, 2.99, 5.99, 29.99, 0.99} // main code ends (still need the below two lines!!) } }