I'm using JDK5 and textpad 4.7.3. Here is the code, if someone can tell me what is wrong and why it won't run I'd really appreciate it. P.S. many thanks
public class ArrayListStrings1 { public static void main(String[] args) { GregorianCalendar aDay = new GregorianCalendar();
int year = aDay.get(GregorianCalendar.YEAR); int month = 1 + aDay.get(GregorianCalendar.MONTH); int day = aDay.get(GregorianCalendar.DATE); String dateOne = "\n" + year + "/" + month + "/" + day; aDay.add(GregorianCalendar.DATE, 14);
year = aDay.get(GregorianCalendar.YEAR); month = 1 + aDay.get(GregorianCalendar.MONTH); day = aDay.get(GregorianCalendar.DATE); String dateTwo = "\n" + year + "/" + month + "/" + day; aDay.add(GregorianCalendar.DATE, 14);
year = aDay.get(GregorianCalendar.YEAR); month = 1 + aDay.get(GregorianCalendar.MONTH); day = aDay.get(GregorianCalendar.DATE); String dateThree = "\n" + year + "/" + month + "/" + day; aDay.add(GregorianCalendar.DATE, 14);
year = aDay.get(GregorianCalendar.YEAR); month = 1 + aDay.get(GregorianCalendar.MONTH); day = aDay.get(GregorianCalendar.DATE); String dateFour = "\n" + year + "/" + month + "/" + day;
//Make ArrayList of four dates, imported java.util.ArrayList
Sorry, I forgot to include System.out.println(fourFortnights); in my posting, but it is in the code. I am getting a runtime error and I was hoping someone could explain why.