class Count{ public boolean compare(int a,int b){ if (a==b){ return true; }else { return false; } } } public class Method { public static void main(String[] args) { Count c =new Count(); //创建一个Count类对象 可以用compare方法 //调用函数 使用布尔值 进行接收 boolean bool = c.compare(8520,8520); System.out.println("两个值是否相等:"+bool); } }
java判断两个值是否相等
最新推荐文章于 2024-10-16 10:10:58 发布