public class Chp2Basic
{ public static void main(String[] args)
{
byte a=8;
char ch='a';
short b=16;
int c=32;
long d=64;
float e=32.0f;
double f=64.00;
boolean g=true,h=false,i,j;
String str="hello!";
i=g&&h; //g与h需是boolean型
j=g&h;
int m=~a; //m可以是int long ..型
int x=32>>>2; //移位运算 类型得是int
int y=b>>>2;
System.out.println("i="+i);
System.out.println("j="+j);
System.out.println("m="+m);
System.out.println("x="+x);
System.out.println("y="+y);
}
}
这代码在MyEclipse 软件里运行 有显示 the local variable ch is never read 等好几个这样 这是什么意思?
{ public static void main(String[] args)
{
byte a=8;
char ch='a';
short b=16;
int c=32;
long d=64;
float e=32.0f;
double f=64.00;
boolean g=true,h=false,i,j;
String str="hello!";
i=g&&h; //g与h需是boolean型
j=g&h;
int m=~a; //m可以是int long ..型
int x=32>>>2; //移位运算 类型得是int
int y=b>>>2;
System.out.println("i="+i);
System.out.println("j="+j);
System.out.println("m="+m);
System.out.println("x="+x);
System.out.println("y="+y);
}
}
这代码在MyEclipse 软件里运行 有显示 the local variable ch is never read 等好几个这样 这是什么意思?
j=false
m=-9
x=8
y=4
the local variable ch is never read 这是IDE 善意的提醒~~
/*
Outout:
i=false
j=false
m=-9
x=8
y=4
*/