public class Test {
private static int j=0; private static boolean ture;
private static boolean methodB(int k){
j+=k;
return ture;
}
public static void methodA(int i){
boolean b;
b=i<10|methodB(4);
b=i<10||methodB(8);
}
public static void main(String[] args) {
methodA(0);
System.out.println(j);
}
}
输出结果是什么,怎么分析这个程序?
private static int j=0; private static boolean ture;
private static boolean methodB(int k){
j+=k;
return ture;
}
public static void methodA(int i){
boolean b;
b=i<10|methodB(4);
b=i<10||methodB(8);
}
public static void main(String[] args) {
methodA(0);
System.out.println(j);
}
}
输出结果是什么,怎么分析这个程序?
b=i<10||methodB(8);
区别逻辑运算符号的
自己去看看把, && 和 &, || 和 |的区别是甚么?