
阅读下面的代码说出输出的结果package com.itheima.test; public class OperatorTest2 { public static void main(String[] args) { int a 3; int b (a) (a) (a * 10); System.out.println(a); System.out.println(b); } }首先中先进行括号内的计算a先进行自增运算结果为4所以括号内为4。后续a后自增a的值还是4计算完成后a的值成了5最后计算a*10所以最终b的值输出为445058.所以最终输出的结果为5和58public class Test { public static void main(String[] args) { int a 10 int b 20 System.out.println( (a b || a b) a b) } } public class Test { public static void main(String[] args) { int a 10 int b 20 System.out.println(a b || (a b a b) ) } }上面的代码中优先计算左侧的ab || ab,结果为true,再计算true ab,得出答案为false。下面的同样先行计算左侧得出false右侧显然为false最终答案输出为false