逻辑运算

public class LOG {

	public static void main(String[]args)
	{
		int t1=2,t2,t3;
		t2=t3=3;
		System.out.println("logical exp.value="+((t1>2)&(t2++==5)));
		System.out.println("t2="+t2);
		System.out.println("logical exp.value="+((t1>2)&&(t3==5)));
		System.out.println("t3="+t3);
		
		
	}
	
}


结果:

logical exp.value=false
t2=4
logical exp.value=false
t3=3


 

你可能感兴趣的:(逻辑运算)