| Gzu521.com我的学习网 |
|
(22)下列代码的执行结果是 public class test { public int amethod() { static int i=0; i++; system.out.println(i); } public static void main(string args[]) { test test = new test(); test.amethod(); } } a)编译错误 b)0 c)1 d)运行成功,但不输出 (23)下列关于内部类的说法不正确的是 a)内部类的类名只能在定义它的类或程序段中或在表达式内部匿名使用 b)内部类可以使用它所在类的静态成员变量和实例成员变量 c)内部类不可以用abstract修饰符定义为抽象类 d)内部类可作为其他类的成员,而且可访问它所在类的成员 (24)顺序执行下列程序语句后,则b的值是 string a="hello"; string b=a.substring(0,2); a)hello b)hello c)hel d)null (25)在onemethod()方法运行正常的情况下,程序段将输出什么? public void test() { try { onemethod(); system.out.println("condition 1"); } catch (arrayindexoutofboundsexception e) { system.out.println("condition 2"); } catch(exception e) { system.out.println("condition 3"); } finally { system.out.println("finally"); } } a)condition 1 b)condition 2 c)condition 3 d)condition 1 finally (26)下列常见的系统定义的异常中,哪个是输入、输出异常? a)classnotfoundexception b)ioexception c)filenotfoundexception d)unknownhostexception (27)下列哪个不是nio包的新特点? a)内存映射技术 b)文件锁定 c)字符及编码 d)阻塞i/o (28)下列哪个选项是正确计算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)); |
责任编辑:gzu521