网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
11. public void genNumbers() { 12. ArrayList numbers = new ArrayList(); 13. for (int i=0; i<10; i++) { 14. int value = i * ((int) Math.random()); 15. Integer intObj = new Integer(value); 16. numbers.add(intObj); 17. } 18. System.out.println(numbers); 19. } Which line of code marks the earliest point that an object referenced by intObj becomes a candidate for garbage collection?()
- A、 Line 16
- B、 Line 17
- C、 Line 18
- D、 Line 19
- E、 The object is NOT a candidate for garbage collection.
参考答案
更多 “ 11. public void genNumbers() { 12. ArrayList numbers = new ArrayList(); 13. for (int i=0; i10; i++) { 14. int value = i * ((int) Math.random()); 15. Integer intObj = new Integer(value); 16. numbers.add(intObj); 17. } 18. System.out.println(numbers); 19. } Which line of code marks the earliest point that an object referenced by intObj becomes a candidate for garbage collection?() A、 Line 16B、 Line 17C、 Line 18D、 Line 19E、 The object is NOT a candidate for garbage collection.” 相关考题
考题
下列程序片段中,能通过编译的是A.public abstract class Animal{ public void speak();}B.public abstract class Animal{ public void speak(){}}C.public class Animal{ public abstract void speak();}D.public abstract class Animal{ public abstract void speak(){}}
考题
指出下列哪个方法与方法public void add(int a){}为合理的重载方法。()A public int add(int a)B public void add(long a)C public void add(int a,int b)D public void add(float a)
考题
Given:10. interface Data { public void load(); }11. abstract class Info { public abstract void load(); }Which class correctly uses the Data interface and Info class?()()
A.B.C.D.E.F.
考题
下列程序片段中,能通过编译的是( )。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( ){};}
考题
下列程序片段中,能通过编译的是( )。 A.public abstract class Animal{ public void speak;}S
下列程序片段中,能通过编译的是( )。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{};}
考题
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?() A、 StackOverflowErrorB、 NullPointerExceptionC、 NumberFormatExceptionD、 IllegalArgumentExceptionE、 ExceptionlnlnitializerError
考题
如果获取XML文档中某一行的数据,需调用()方法。A、public void setDocumentLocator()B、public void unparsedEntityDecl()C、public void fatalError()D、public void startDocument()
考题
当解析器解析到文档中命名空间,会调用()方法。A、public void startPrefixMapping()B、public void startDocument()C、public void setDocumentLocator()D、public void characters()
考题
interface Data { public void load(); } abstract class Info { public abstract void load(); } Which class correctly uses the Data interface and Info class?() A、 public class Employee extends Info implements Data { public void load() { /*do something*/ } }B、 public class Employee implements Info extends Data { public void load() { /*do something*/ } }C、 public class Employee extends Info implements Data { public void load() { /*do something */ } public void Info.load() { /*do something*/ } }D、 public class Employee implements Info extends Data { public void Data.load() { /*dsomething */ } public void load() { /*do something */ } }E、 public class Employee implements Info extends Data { public void load() { /*do something */ } public void Info.load(){ /*do something*/ } }F、 public class Employee extends Info implements Data{ public void Data.load() { /*do something*/ } public void Info.load() { /*do something*/ } }
考题
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?()A、 public void setEnabled( boolean enabled) public boolean getEnabled()B、 public void setEnabled( boolean enabled) public void isEnabled()C、 public void setEnabled( boolean enabled) public boolean isEnabled()D、 public boolean setEnabled( boolean enabled) public boolean getEnabled()
考题
当解析器解析到文档中一条指令时,会调用()方法。A、public void processingInstruction()B、public void skippedEntity()C、public void unparsedEntityDecl()D、public void startDocument()
考题
下列方法中,与方法public void add(inta){}为合理重载的方法是()。A、public int add(int a)B、public void add(long a)C、public void add(int a)D、public void add(int a,int b)
考题
作为类中新线程的开始点,线程的执行是从()方法开始的。A、public void start()B、public void run()C、public void int()D、public static void main(Stringargs[])
考题
下面那一个函数是线程的入口函数? ()A、private void run()B、public void run()C、public void start()D、public void begin()
考题
Which method must be defined by a class implementing the java.lang.Runnable interface? () A、 void run()B、 public void run()C、 public void start()D、 void run(int priority)E、 public void run(int priority)F、 public void start(int priority)
考题
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?() A、 Line 13B、 Line 14C、 Line 18D、 Line 20
考题
现有: interface Data {public void load();} abstract class Info {public abstract void load();} 下列类定义中正确使用Data和Info的是哪项?() A、 public class Employee implements Info extends Data { public void load(){/*dosomething*/} }B、public class Employee extends Inf.implements Data{ public void load() {/*do something*/} }C、public class Empl.yee implements Inf extends Data{ public void Data.1oad(){* do something*/} public void load(){/*do something*/} }D、public class Employee extends Inf implements Data { public void Data.1oad() {/*do something*/) public void info.1oad(){/*do something*/} }
考题
public class Test {} What is the prototype of the default constructor?() A、 Test()B、 Test(void)C、 public Test()D、 public Test(void)E、 public void Test()
考题
单选题Which method must be defined by a class implementing the java.lang.Runnable interface? ()A
void run()B
public void run()C
public void start()D
void run(int priority)E
public void run(int priority)F
public void start(int priority)
考题
单选题interface Data { public void load(); } abstract class Info { public abstract void load(); } Which class correctly uses the Data interface and Info class?()A
public class Employee extends Info implements Data { public void load() { /*do something*/ } }B
public class Employee implements Info extends Data { public void load() { /*do something*/ } }C
public class Employee extends Info implements Data { public void load() { /*do something */ } public void Info.load() { /*do something*/ } }D
public class Employee implements Info extends Data { public void Data.load() { /*dsomething */ } public void load() { /*do something */ } }E
public class Employee implements Info extends Data { public void load() { /*do something */ } public void Info.load(){ /*do something*/ } }F
public class Employee extends Info implements Data{ public void Data.load() { /*do something*/ } public void Info.load() { /*do something*/ } }
考题
单选题1. public class SimpleCalc { 2. public int value; 3. public void calculate() { value += 7; } 4. } And: 1. public class MultiCalc extends SimpleCalc { 2. public void calculate() { value -= 3; } 3. public void calculate(int multiplier) { 4. calculate(); 5. super.calculate(); 6. value *=multiplier; 7. } 8. public static void main(String[] args) { 9. MultiCalc calculator = new MultiCalc(); 10. calculator.calculate(2); 11. System.out.println(”Value is: “+ calculator.value); 12. } 13. } What is the result?()A
Value is: 8B
Compilation fails.C
Value is: 12D
Value is: -12E
The code runs with no output.F
An exception is thrown at runtime.
考题
多选题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?()Apublic void setEnabled( boolean enabled) public boolean getEnabled()Bpublic void setEnabled( boolean enabled) public void isEnabled()Cpublic void setEnabled( boolean enabled) public boolean isEnabled()Dpublic boolean setEnabled( boolean enabled) public boolean getEnabled()
考题
多选题Which two code fragments will execute the method doStuff() in a separate thread?()Anew Thread() {public void run() { doStuff(); }};Bnew Thread() {public void start() { doStuff(); }};Cnew Thread() {public void start() { doStuff(); }}.run();Dnew Thread() {public void run() { doStuff(); }}.start();Enew Thread(new Runnable() {public void run() { doStuff(); }}).start();
考题
单选题1. interface A { public void aMethod(); } 2. interface B { public void bMethod(); } 3. interface C extends A,B { public void cMethod(); } 4. class D implements B { 5. public void bMethod() { } 6. } 7. class E extends D implements C { 8. public void aMethod() { } 9. public void bMethod() { } 10. public void cMethod() { } 11. } What is the result?()A
Compilation fails because of an error in line 3.B
Compilation fails because of an error in line 7.C
Compilation fails because of an error in line 9.D
If you define D e = new E(), then e.bMethod() invokes the version of bMethod()defined in Line 5.E
If you define D e = (D)(new E()),then e.bMethod() invokes the version of bMethod() defined in Line 5.F
If you define D e = (D)(new E()), then e.bMethod() invokes the version of bMethod() defined in Line 9.
考题
单选题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?()A
StackOverflowErrorB
NullPointerExceptionC
NumberFormatExceptionD
IllegalArgumentExceptionE
ExceptionlnlnitializerError
考题
多选题Which two code fragments will execute the method doStuff() in a separate thread?()Anew Thread() { public void run() { doStuff(); } }Bnew Thread() { public void start() { doStuff(); } }Cnew Thread() { public void start() { doStuff(); } } .run();Dnew Thread() { public void run() { doStuff(); } } .start();Enew Thread(new Runnable() { public void run() { doStuff(); } } ).run();Fnew Thread(new Runnable() { public void run() { doStuff(); } }).start();
考题
单选题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?()A
Line 13B
Line 14C
Line 18D
Line 20
考题
单选题public class Test {} What is the prototype of the default constructor?()A
Test()B
Test(void)C
public Test()D
public Test(void)E
public void Test()
热门标签
最新试卷