Java经典例题 逻辑运算+自增自减

public class Test{
	public static void main(String[] args){
	
		boolean x = true;
		boolean y = false;
		short z = 42;
		if((z++ == 42)&&(y = true))
			System.out.println("z1 = " + z);	//43
			z++;
			System.out.println("z2 = " + z);	//44

		if((x = false) || (++z == 45))
			System.out.println("z3 = " + z);	//45
			z++;
			System.out.println("z4 = " + z);	//46
	}	
}

你可能感兴趣的:(JAVA,java,算法)