-3
package date;
import javax.swing.JOptionPane;
public class SpeedDatingTest {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
String CDay = JOptionPane.showInputDialog("Enter the year: ");
int cDay = Integer.parseInt(CDay);
Date date = new Date(cDay);
System.out.println(date.discoverColumbusDay);
}
}
NetBeans告訴我「Date date = new Date(cDay)」給了我一個RuntimeException,我不知道爲什麼。誰能幫忙?RuntimeException:不可編譯的源代碼。 Java(NetBeans)
你在哪裏導入Date類? – Jens
什麼是日期,你自己寫的課程? – Joni
'date.discoverColumbusDay'是什麼? –