relationexam.java

来自「Java程序设计实用教程源代码 本书源代码按章分别放置在不同的文件夹中,所有程」· Java 代码 · 共 31 行

JAVA
31
字号
public class relationExam{
    public static void main(String[] args) {
        //变量定义
        int x = 34;
        int y = 58;
        int z = 58;
	    //大于
        System.out.println("    x > y = " + (x > y));	  //false
        System.out.println("    y > x = " + (y > x));     //true
        System.out.println("    z > y = " + (z > y));     //false
	    //大于或等于
        System.out.println("    x >= y = " + (x >= y));   //false
        System.out.println("    y >= x = " + (y >= x));   //true
        System.out.println("    z >= y = " + (z >= y));   //true
	    //小于
        System.out.println("    x < y = " + (x < y));     //true
        System.out.println("    y < x = " + (y < x));     //false
        System.out.println("    z < y = " + (z < y));     //false
	    //小于或等于
        System.out.println("    x <= y = " + (x <= y));   //true
        System.out.println("    y <= x = " + (y <= x));   //false
        System.out.println("    z <= y = " + (z <= y));   //true
	    //等于
        System.out.println("    x == y = " + (x == y));   //false
        System.out.println("    z == y = " + (z == y));   //true
	    //不等于
        System.out.println("    x != y = " + (x != y));   //true
        System.out.println("    z != y = " + (z != y));   //false
    }   
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?