int a = 3, b = 2;//成员变量
/**
* 关系运算符
*/
@Test
public void test2() {
System.out.println("=====等等(==)=====");
// 结果返回true或false
System.out.print("a == b =");
System.out.println(a == b);
System.out.println();
System.out.println("=====不等(!=)=====");
System.out.print("a != b =");
System.out.println(a != b);
System.out.println();
System.out.println("=====大于(>)=====");
System.out.print("a > b =");
System.out.println(a > b);
System.out.println();
System.out.println("=====小于(<)=====");
System.out.print("a < b =");
System.out.println(a < b);
System.out.println();
System.out.println("=====大于等于(>=)=====");
System.out.print("a >= b =");
System.out.println(a >= b);// 当a大于b或者等于b时结果为true
System.out.println();
System.out.println("=====小于等于(<=)=====");
System.out.print("a <= b =");
System.out.println(a <= b);// 当a大于b或者等于b时结果为true
}
运行结果:
=====等等(==)=====
a == b =false
=====不等(!=)=====
a != b =true
=====大于(>)=====
a > b =true
=====小于(<)=====
a < b =false
=====大于等于(>=)=====
a >= b =true
=====小于等于(<=)=====
a <= b =false
int a = 3, b = 2;//成员变量 /** * 关系运算符 */ @Test public void test2() { System.out.println(&amp;amp;quot;=====等等(==)=====&amp;amp;quot;); // 结果返回true或false System.out.print(&amp;amp;quot;a == b =&amp;amp;quot;); System.out.print