我是刚开始学习java的学生。在我正在研究的一个小项目中,我得到了这个编译错误:
myDate2.java:15: error: cannot find symbol
该错误与“mday / mon / yer”整数有关(如果我不正确,请原谅我) 我究竟做错了什么?我错过了大写字母,还是什么? 任何帮助将不胜感激!
import java.util.Date;
import javax.swing.*;
public class myDate2
{
private int mmday=0;
private int mmmon=0;
private int myear=0;
private Date mDate;
myDate2()
{
System.out.println("running myDate constructor");
mDate=new mDate();
}
public void dateInt()
{
mday=mDate.getDate(); //1-30
mmon=mDate.getMonth(); //0-11
myer=mDate.getYear()+1900; //Year
}
public void showDate()
{
System.out.println("Day: " + mday + "Month: " + mmon + "Year: " + myer);
}
public static void main(String []arg)
{
myDate obj=new myDate();
obj.showDate(); //mday:0 mmonth:0 year:0
obj.dateInt(); //date variables
obj.showDate();
System.out.println("end of run");
}
}