题目内容

以下哪些语句存在语法错误?

A. dcfault String s;
B. transient int i=41;
C. public final static native int w();
D. abstract double d;
E. abstract final double hyperbolicCosine();

查看答案
更多问题

哪些赋值语句正确?

A. float foo=-1;
B. float 0foo=1.0;
C. float 0foo=42cl;
D. float 0foo=2.02f;
E. float 0foo=3.03d;
F. float 0foo=0x0123;

以下哪些语句无编译错误?

A. StringBuffer sb1=”abcd”;
Booleam b=new Booleam (“abcd”);
C. byte b=255;
D. int x=0x1234;
E. float f1=1.2;

以下哪些语句实现了将数值5赋值给一个int型变量?

A. int testValue=0x5;
B. int testValue=(int) (2.1F+3.4D);
C. int testValue=(octal)5;
D. int testValue=(0x0A>>1);
E. i nt testValue=(0x0A>>>1);

以下那些表达式正确?

A. Object o = new String(“abcd”);
Boolean b = true;
C. Panel p = new Frame();
D. Applet a = new Panel();
E. Panel p = new Applet();

答案查题题库