18. 为了获得参数lastname,在applet中可以写如下代码: A. String s=getName(“lastname”); B. String s=parameter(“lastname”); C. String s=getParameter(“lastname”); D. ...
9. 65. 已知有下列类的说明,则下列哪个语句是正确的? public class Test { private float f = 1.0f; int m = 12; static int n=1; public static void main(String arg[]) { Test t = new Test(); } } A. t.f; B. this.n; ...
7. 选择所有有效的构造函数。 class Happy { } } A. public void Happy(){} B. public Happy(int c){} C. protected Happy(){} D. public int Happy(){} E. void Happy(){} ...
1. 给出下面的代码段: public class Base{ int w, x, y ,z; public Base(int a,int b) { x=a; y=b; } public Base(int a, int b, int c, int d) { //赋值 x=a, y=b w=d; z=c; } } 在代码说明//赋值 x=a, y=b处写入如下哪几行代码是正确的? A...
16. 下列哪个选项是正确计算42度(角度)的余弦值? A. double d=Math.cos(42); B. double d=Math.cosine(42); C. double d=Math.cos(Math.toRadians(42)); D. double d=Math.cos(Math.toDegrees(42)); ...
11. 在Java Applet程序用户自定义的Applet子类中,常常重载( )方法在Applet的界面中显示文字、图形和其它界面元素。 A. start( ) B. stop( ) C. init( ) D. paint( ) ...
5. 下列类头定义中,错误的是( )。 A. class x { .... } B. public x extends y { .... } C. public class x extends y { .... } D. class x extends y implements y1 { .... } ...
10. 下面那些话是正确的? A. >> 是算术右移操作符 B. >> 是逻辑右移操作符 C. >>> 是算术右移操作符 D. >>> 是逻辑右移操作符 ...
1. 下面哪些赋值语句是合法的? A. float a = 2.0; B. double b = 2.0; C. int c = 2; D. long d = 2; ...
14. 给出下列的代码,哪行在编译时可能会有错误? ① public void modify(){ ② int i, j, k; ③ i = 100; ④ while ( i > 0 ){ ⑤ j = i * 2; ⑥ System.out.println (" The value of j is " + j ); ⑦ k = k + 1; ⑧ } ⑨ } A...