0

I am student just starting to learn java. On one of our little projects I'm working on, I get this compiler error:

myDate2.java:15: error: cannot find symbol

the error has something to do with the "mday/mon/yer" integers (forgive me if I am incorrect) What am I doing wrong? Am I missing a capital letter, or what? Any help will be greatly appreciated!

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");
}

}   
sepp2k
  • 363,768
  • 54
  • 674
  • 675
Jake Dank
  • 1
  • 2
  • Look at the line that the error message tells you is in error, and there you'll find the problem. I looks like you're trying to create an object of a class that does not exist. Remember that spelling capitalization, all are very important, and that the Java compiler is unforgiving. – Hovercraft Full Of Eels Sep 16 '15 at 02:42
  • @HovercraftFullOfEels Thank you, I figured out my error (: – Jake Dank Sep 16 '15 at 02:56

0 Answers0