public class Test3 {
//关系运算符->true/false
public static void main(String[] args) {
int a = 10;
int b = 20;
int c = 21;
System.out.println(c%a);// c/a 21/10=2...1 求余数运算
System.out.println(a<b);//10<20? ->true
System.out.println(a>b);//10>20? ->false
System.out.println(a==b);//10==20? ->false
System.out.println(a<=b);//10<=20? ->true
System.out.println(a>=b);//10>=20? ->false
System.out.println(a!=b);//10!=20? ->true
}
}
Java关系运算符
最新推荐文章于 2024-07-13 22:31:13 发布