class lesson2
{
public static void main(String[] args)
{
/*int x=1,y=1;
if(x++==2&++y==2)
{
x=7;
}
System.out.println("x="+x+",y="+y);
*/
/*int x = 1,y = 1;
if(x++==2 && ++y==2)
{
x =7;
System.out.println(x);
}
System.out.println("x="+x+",y="+y);
*/
/*
短路与:
&:左边无论什么结果,右边都执行。
&&:左边为false,右边不执行,结果为false。
短路或:
|:左边无论什么结果,右边都执行。
||:左边为true,右边不执行,结果为true。
*/
/* int x = 1,y = 1;
if(x++==1 || ++y==1)
{
x =7;
}
System.out.println("x="+x+",y="+y);
boolean b = true;
if(b==false)
System.out.println("a");
else if(b)
System.out.println("b");
else if(!b)
System.out.println("c");
else
System.out.println("d");
*/
int x = 2,y=3;
switch(x)
{
default:
y++;
//case 3:
//y++;
case 4:
y++;
}
System.out.println("y="+y);
}
}