案例:两只老虎

案例:两只老虎

//需求:两只老虎的体重分别为180kg和200kg,用程序判断两只老虎的体重是否相同
public class HelloWorld{
    
    
    public static void main(String[] args){
    
    
        int weight1 = 180;
        int weight2 = 200;
        boolean a = weight1 == weight2?true:false;
        System.out.println("a:" + a);

    }
}

猜你喜欢

转载自blog.csdn.net/taoyingle/article/details/115048767