import javax.swing.JOptionPane; /** * Shows an example of a constructor, * a toString() method, and an array of objects, * for a simple class * * @author William Albritton */ public class SimpleClass { /** * The main method starts the program * * @param args are not used */ public static void main(String[] args) { // create three President objects President president44 = new President("Barack", "Obama", 44); President president43 = new President("George", "Bush", 43); President president42 = new President("William", "Clinton", 42); // output three President objects System.out.println("The three most recent presidents are:"); System.out.println(president44.toString() + "\n" + president43.toString() + "\n" + president42.toString() + "\n"); //create an array of three President objects final Integer MAX = 3; President array[] = new President[MAX]; //output the array System.out.println("Display Presidents array[] without initializing elements:"); System.out.println("index object"); for(int i=0;i