The operator <= is undefined for the argument type(s) boolean, int怎么处理???

publicclassBrithday{publicBrithday(){System.out.println("ThisisaBrithday");}publicBri... public class Brithday {
public Brithday(){System.out.println("This is a Brithday");}
public Brithday(int year,int month,int day){
this.year = year;
this.month = month;
this.day = day;
}
private int year;
private int month;
private int day;
public int getyear(){return year;}
public void setyear(int year){this.year = year;}
public int getmonth(){return month;}
public void setmonth(int month){this.month = month;}
public int getday(){return day;}
public void setday(int day){this.day = day;}
public void display(){
System.out.println(year);
System.out.println(month);
System.out.println(day);
}
public static boolean main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
Brithday bri1 = new Brithday();
System.out.println("请输入Brithday:");
int year = in.nextInt();
int month = in.nextInt();
int day = in.nextInt();
bri1.setyear(year);
bri1.setmonth(month);
bri1.setday(day);
if(1900<year<=2013 && 1<=month<=12 && 1<=day<=31){
bri1.display();
}
else{ return false;}
in.close();
}
展开
 我来答
syht2000
高粉答主

2013-09-04 · 关注我不会让你失望
知道大有可为答主
回答量:3万
采纳率:79%
帮助的人:1.4亿
展开全部
没有 1900<year<=2013这种写法的,你要写作
if(1900<year && year<=2013 && 1<=month && month<=12 && 1<=day && day<=31){
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式