java 逻辑运算符的应用

来源:互联网 发布:鲁滨逊漂流记java安卓 编辑:程序博客网 时间:2024/05/21 14:58

源程序:

public class Test{
 public static void main(String args[]){
  boolean x = true ;
  boolean y = false ;
  System.out.println("x&& y = " +(x && y)) ;
  System.out.println("x & y =" +(x & y)) ;
  System.out.println("x || y = "+(x || y)) ;
  System.out.println("x | y = "+(x | y)) ;
 }
}

运行结果:

java <wbr>逻辑运算符的应用

0 0
原创粉丝点击