利用关系运算符连接的式子成为关系表达式。
关系运算就是比较运算符号(6个:== 、!=、 > 、<、 >=、 <=)
public class C2_8
{
public static void main(String args[])
{
boolean x,y;
double a,b;
a=12.56;
b=233.23;
x=(a!=b);
y=(a==b);
System.out.println("(a>b)="+(a>b));
System.out.println("x="+x);
System.out.println("y="+y);
}
}
结果