11. public void addStrings(List list) { 12. list.add(”foo”); 13. list.add(”bar”); 14. } What must you change in this method to compile without warnings?()
第1题:
下列程序片段中,能通过编译的是( )。
A.public abstract class Animal{ public void speak;}
B.public abstract class Animal{ public void speak{);}
C.public class Animal{ pubilc abstract void speak;}
D.public abstract class Animal{ pubile abstract void speak{};}
第2题:
如果获取XML文档中某一行的数据,需调用()方法。
第3题:
interface Data { public void load(); } abstract class Info { public abstract void load(); } Which class correctly uses the Data interface and Info class?()
第4题:
当解析器解析到文档中一条指令时,会调用()方法。
第5题:
作为类中新线程的开始点,线程的执行是从()方法开始的。
第6题:
Which method must be defined by a class implementing the java.lang.Runnable interface? ()
第7题:
现有: interface Data {public void load();} abstract class Info {public abstract void load();} 下列类定义中正确使用Data和Info的是哪项?()
第8题:
void run()
public void run()
public void start()
void run(int priority)
public void run(int priority)
public void start(int priority)
第9题:
Value is: 8
Compilation fails.
Value is: 12
Value is: -12
The code runs with no output.
An exception is thrown at runtime.
第10题:
new Thread() {public void run() { doStuff(); }};
new Thread() {public void start() { doStuff(); }};
new Thread() {public void start() { doStuff(); }}.run();
new Thread() {public void run() { doStuff(); }}.start();
new Thread(new Runnable() {public void run() { doStuff(); }}).start();
第11题:
StackOverflowError
NullPointerException
NumberFormatException
IllegalArgumentException
ExceptionlnlnitializerError
第12题:
Line 13
Line 14
Line 18
Line 20
第13题:
10. public class ClassA { 11. public void count(int i) { 12. count(++i); 13. } 14. } And: 20. ClassA a = new ClassA(); 21. a.count(3); Which exception or error should be thrown by the virtual machine?()
第14题:
当解析器解析到文档中命名空间,会调用()方法。
第15题:
A JavaBeans component has the following field: 11. private boolean enabled; Which two pairs of method declarations follow the JavaBeans standard for accessing this field?()
第16题:
下列方法中,与方法public void add(inta){}为合理重载的方法是()。
第17题:
下面那一个函数是线程的入口函数? ()
第18题:
11. public class Test { 12. public void foo() { 13. assert false; 14. assert false; 15. } 16. public void bar(){ 17. while(true){ 18. assert false; 19. } 20. assert false; 21. } 22. } What causes compilation to fail?()
第19题:
public class Test {} What is the prototype of the default constructor?()
第20题:
public class Employee extends Info implements Data { public void load() { /*do something*/ } }
public class Employee implements Info extends Data { public void load() { /*do something*/ } }
public class Employee extends Info implements Data { public void load() { /*do something */ } public void Info.load() { /*do something*/ } }
public class Employee implements Info extends Data { public void Data.load() { /*dsomething */ } public void load() { /*do something */ } }
public class Employee implements Info extends Data { public void load() { /*do something */ } public void Info.load(){ /*do something*/ } }
public class Employee extends Info implements Data{ public void Data.load() { /*do something*/ } public void Info.load() { /*do something*/ } }
第21题:
public void setEnabled( boolean enabled) public boolean getEnabled()
public void setEnabled( boolean enabled) public void isEnabled()
public void setEnabled( boolean enabled) public boolean isEnabled()
public boolean setEnabled( boolean enabled) public boolean getEnabled()
第22题:
Compilation fails because of an error in line 3.
Compilation fails because of an error in line 7.
Compilation fails because of an error in line 9.
If you define D e = new E(), then e.bMethod() invokes the version of bMethod()defined in Line 5.
If you define D e = (D)(new E()),then e.bMethod() invokes the version of bMethod() defined in Line 5.
If you define D e = (D)(new E()), then e.bMethod() invokes the version of bMethod() defined in Line 9.
第23题:
new Thread() { public void run() { doStuff(); } }
new Thread() { public void start() { doStuff(); } }
new Thread() { public void start() { doStuff(); } } .run();
new Thread() { public void run() { doStuff(); } } .start();
new Thread(new Runnable() { public void run() { doStuff(); } } ).run();
new Thread(new Runnable() { public void run() { doStuff(); } }).start();
第24题:
Test()
Test(void)
public Test()
public Test(void)
public void Test()