开发者社区 问答 正文

关于Boolean方法调用的问题,一直报错 ?报错

图片说明

报错说明为:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method Isn(int) is undefined for the type Even_num
at day07.Even_num.main(Even_num.java:11)

展开
收起
爱吃鱼的程序员 2020-06-24 13:28:31 620 分享 版权
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    Isn没有定义,把下面函数修改为
    publicstaticbooleanisEven(intb){//加上static
    然后把调用修改为
    result=isEven(n);

    2020-06-24 13:28:46
    赞同 展开评论
问答标签:
问答地址: