单项选择题
现有: 1. interface Altitude { 2. //insert code here 3. } 和4个声明: int HIGH = 7; public int HIGH = 7; abstract int HIGH = 7; interface int HIGH = 7; 分别插入到第2行,有多少行可以编译?()
A. 0 B. 1 C. 2 D. 3 E. 4
现有: class Parser extends Utils { public static void...
现有: class Parser extends Utils { public static void main(String [] args) { System.out.print(new Parser().getInt("42")); } int getInt(String arg) { return Integer.parseInt(arg); } } class Utils { int getInt(String arg) throws Exception { return 42; } } 结果为()
A. 42 B. 编译失败。 C. 无输出结果。 D. 运行时异常被抛出。
类Student代码如下: class Student{ String name; int age;...
类Student代码如下: class Student{ String name; int age; Student(String nm){ name = nm; } } 执行语句Student stu = new Student()后,字段age的值是哪项?()
A. 0 B. null C. false D. 编译错误
下列关于Java对象清除的叙述正确的是哪项?()A. 对象被创建后,立刻变成垃圾对象B. 任何不再被引用的对象...
单项选择题下列关于Java对象清除的叙述正确的是哪项?()
A. 对象被创建后,立刻变成垃圾对象 B. 任何不再被引用的对象都是垃圾收集的对象 C. 一旦对象失去引用,垃圾收集器立刻把它从内存中清除 D. Java对象的清除必须自己手动处理