I have this code:
import javax.swing.JOptionPane;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.*;
import java.text.*;
public class BillionSeconds {
public static void main(String[] args)
{
Date thedate ;
String Birthday = JOptionPane.showInputDialog("What is your birthday in the form dd-MM-yy");
DateFormat dateFormat = new SimpleDateFormat("dd/MMM/yy");
try{
thedate = dateFormat.parse(Birthday);
}
catch (Exception e) {
System.out.println("Unable to parse date stamp");
}
Date newdate = thedate.add(thedate, 1);
}
}
但我得到这个错误,我不知道为什么:
error: cannot find symbol method add(Date,int)