// DrJava saved history v2 /* I was unable to retrieve the history */ /* from Friday, so I have created something */ /* similar. */ import javax.swing.JOptionPane; String input = JOptionPane.showInputDialog("Tell me something new!"); input String moreInput = JOptionPane.showInputDialog("Tell me something wonderful!"); input2 moreInput moreInput = input BankAccount chanda = new BankAccount("Chanda", 500.00); BankAccount chanda = new BankAccount("Chanda", 500.00); chanda.verifyAmount(400.00) chanda.verifyAmount(550.00) /* now try to create a bank account using the prompt */ BankAccount dave = new BankAccount(); dave.getName() dave.deposit(125.40) dave.getNameAmt() /* try creating bank accounts using all of the constructor methods that we have created */ /* now we look at another class which is part of the java API - Date */ /* since date manipulation falls into the category of utility, we look at the java API */ /* on the web and see that it is a class found under java.util. */ /* so we make it available using the import statement */ import java.util.Date; Date today = new Date(); today /* lets create the date September 3, 2004 */ Date anotherDate = new Date(2004, 9, 3) /* now lets look at the date we created */ anotherDate /* hmmm something is wrong here - if you look at the API */ /* you will see that A year y is represented by the integer y - 1900. */ /* and that a month is represented by an integer from 0 to 11; 0 is January, 1 is February, and so forth; thus 11 is December */ /* so if we wanted to create September 3, 2004 we would have to create it this way: */ anotherDate = new Date(104, 8, 3); /* now lets look at the date we created again */ anotherDate /* to get the individual parts of the date */ anotherDate.getYear() anotherDate.getMonth() anotherDate.getDate() /* How is today's date represented? */ today.getYear() today.getMonth() today.getDate()