0
public class Test1
{
    private int day;
    private int year;
    private int month;
    public void setDay(int newDay)
    {
    day = newDay;
    }
    public void setMonth(int newMonth)
    {
    month = newMonth;
    }
    public void setYear(int newYear)
    {
    year = newYear;
    }
    public int getDay()
    {
    return day;
    }
    public int getYear()
    {
    return year;
    }
    public getMonth()
    {
    return month;
    }
    public void plus()
    {
    setDay(1+getDay());
    }
    public void writeOut()
    {
    System.out.println(this.month+" "+this.day+" "+this.year);
    }
    public static void main(String[]args)
    {
       Test date1 = new Test();
       date1.setDay(14);
       date1.setMonth(2);
       date1.setYear(1991);
       date1.plus();
       date1.writeOut();
    }
}

I am trying to use the plus method to add the day by 1. However, I don't know why it cannot find symbol - method plus(). What is the problem with my code? Please help me figure it out. I appreciate it.

user unknown
  • 35,537
  • 11
  • 75
  • 121

0 Answers0