`
gg19861207
  • 浏览: 179824 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

我在工商讲课的时候准备的一些东西

阅读更多

public class Vari{
static int i = 0;
static short s = 1;
static byte b = 2;
static long l ;
static char c;
static float f;
static double d;
static boolean bl;
static int ib = -5;

public static void main(String[] args){

System.out.println("i = " + i);
System.out.println("s = " + s);
System.out.println("b = " + b);
System.out.println("l = " + l);
System.out.println("c = " + c);
System.out.println("f = " + f);
System.out.println("d = " + d);
System.out.println("bl = " + bl);

System.out.println("5's binary string is:" + Integer.toBinaryString(5));
System.out.println("-5's binary string is:" + Integer.toBinaryString(-5));
System.out.println("128's binary string is:" + Integer.toBinaryString(128));
System.out.println("-128's binary string is:" + Integer.toBinaryString(-128));
System.out.println("1 | 5 = " + (1 | 5));
System.out.println("1 & 5 = " + (1 & 5));
System.out.println("1 ^ 5 = " + (1 ^ 5));

if(5>3 && 5>4){
System.out.println("5>3 && 5>4" );
}

System.out.println("5>>3 = " + (5>>3) );
System.out.println("5>>>3 = " + (5>>3) );
System.out.println("-5>>3 = " + (-5>>3) );
System.out.println("-5>>>3 = " + (-5>>>3) );
System.out.println("5<<3 = " + (5<<3) );
System.out.println("-5<<3 = " + (-5<<3) );
System.out.println("5<<32 = " + (5<<32) );
System.out.println("-5<<32 = " + (-5<<32) );

System.out.println("bl = " + (bl = (5<3)?true:false ));

for(int iter=0;iter<9;iter++){
if(iter == 6){
continue;

}
System.out.println("iter " + iter);
}


for(int iter=0;iter<9;iter++){
if(iter == 6){
break;

}
System.out.println("iter " + iter);
}

}
}

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics