求助
各位高手请帮我这个java错在那里class NyDateException extends Exception{
private String reason;
public MyDateException (String r) {
reason=r;
}
public String getReason(){
return(reason);
}
}
class Mydate{
int yeat,month,day;
void SetDay(int y,int m,int d){
if(d>31){
throw new MyDateException("day too big");
}
}
}
class ab{
public static void main(String[] tt){
Mydate b=new Mydate();
try{
b.setDay(2001,12,123);
}
catch(MyDateException v){
System.out.println(v.getReason());
}
}
}