public class Date {
private int _day;
private int _month;
private int _year;
boolean checkDate=true;
public Date(int day,int month,int year) {
if ((day>31)||(day<1)) {
System.out.println("You entered a wrong day");
checkDate=false;}
else if ((month>12)||(month<1)) {
system.out.println("You entered a wrong month");
checkDate=false;}
if (checkDate=true) {
_day=day;
_month=month;
_year=year;
}
}
public Date() {
_day=3;
_month=1;
_year=2009; }
public int getDay {
return _day;
}
public int getMonth {
return _month;
}
public int getYear {
return _year;
}
public StringtoString{
String str= "";
str+="day:"+getDay()+" ";
str+="month:"+getMonth()+" ";
str+="year:"+getYear()+" ";
return str;
}
}
Hey, maybe someone one can help me?
I've got an error message from the compiler " ';' expected".
I'm very new in this, so i don't know what to do.
Thanks for any kind of help. :S