首页/ 题库 / [单选题]11.public void genNu的答案

11.public void genNumbers(){
12.ArrayList numbers=new ArrayList();
13.for(inti=0;i<10;i++){
14.intvalue=i*((int)Math.random());
15.IntegerintObj=newInteger(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 garbagec ollection?()

单选题
2021-12-31 19:31
A、Line16
B、Line17
C、Line18
D、Line19
E、The object is NOT a candidate for garbage collection.
查看答案

正确答案
D

试题解析

感兴趣题目
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?()()
下面程序段的输出结果是 public class Test { public static void main (String args[]){ int[] a=new int[11]; int[] p=new int [4]; int k=5; for(int i=1;i<=10;i++) a[i]=i; for(int i=1;i<=3;i++) p[i]=a[i*i]; for(int i=1;i<=3;i++) k=k+p[i]*2; System.out.println(k); } }
下面程序的输出结果是( )。 public class Sun { public static void main(String args[ ]) { int[] a=new int[11]; int[] p=new int[4]; int k=5; for(int i=1;i<=10;i++) a[i]=i; for(int i=1;i<=3;i++) p[i]=a[i*i]; for(int i=1;i<=3;i++) k=k+p[i]*2; System.out.println(k);; } }
下面程序段的输出结果是( )。 public class Test {public static void main(String args[]){ int[] a=new int[11]; int[] p=new int[4]; int k=5; for(int i= 1 ; i<= 10;i++) a[i]=i; for(int i=1 ; i<=3;i++) p[i]=a[i*i]; for(int i= 1 ;i<=3;i++) k=k+p[i]*2; System.out.println(k); }}
下面程序段的输出结果是 public class Test { public static void main(String args[]){ int[] a=new int[11]; int[] p=new int[4]; int k=5; for(int i=1;i<=10;i++) a[i]=i; for(int i=l;i<=3;i++) p[i]=a[i*i]; for(int i=1;i<=3;i++) k=k+p[i]*2; System.out.println(k); } }
下面程序段的输出结果是______。 public class Test{ public static void main(String args[ ]){ int[ ]a=new int[11]; int[ ]p=new int[4]; int k=5; for(int i=1;i<=10;i++) a[i]=i; for(int i=1;i<=3;i++) p[i]=a[i*i]; for(int i=1;i<=3;i++) k=k+p[i]*2; System.out.println(k); } }
class java {  public static void main(String [] java) {   for (int Java = 1; Java 〈 java.length; Java++)   System.out.print("java ");   }   }   和命令行:  java java java java java   结果为:()  

class java { 
public static void main(String [] java) {  
for (int Java = 1; Java 〈 java.length; Java++)  
System.out.print("java ");  
}  
}  
和命令行: 
java java java java java  
结果为:()  

现有:
1. class Wrench f
2.public static void main(String [] args) {
3.Wrench w=new Wrench(); Wrench w2=new Wrench();
4. w2=go (w, w2);
5.System.out.print (w2==w);
6. }
7.static Wrench go (Wrench wrl, Wrench wr2) {
8.Wrench wr3=wrl; wrl=wr2; wr2=wr3;
9. return wr3;
10. }
11. }
结果是什么?()

11.public class Commander{ 12.public static void main(String[]args){ 13.String myProp=/*insert code here*/ 14.System.out.println(myProp); 15.} 16.} and the command line: java-Dprop.custom=gobstopper Commander Which two,placed on line13,will produce the output gobstopper?()
提问、小测验、阶段考试、期中考试或作业练习都可以用来进行课堂评价。
Import java.applet.Applet; Import java.awt*;  Public class ImageDemo extends Applet{  Image img;  Public void init(){  Img=getImage(getCodeBase(),”11.gif”);//1 }  Public void paint(Graphics g){ Int w=img.getHeight(this);  Int h=img.getHeight(this);  g.drawImage(img,120,60,w/2,h/2,this);//2  g. drawImage(img,150,0,w*2,h*2,this);//3 }  }以上代码第()行将图像放大。 
相关题目
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?()()
下列语句序列执行后,K的值是______。 public class Test11 { public static void main(String[] args) { int m=3, n=6, k=0; while ((m++)<(n--)) ++k; System.out.println (k); } }
下列代码中,将引起一个编译错误的行是( )。 1)public class Test{ 2)int m,n; 3)public Test{} 4)public Test(int a){m=a;) 5)public static void main(String args[]){ 6)Test tl,t2; 7)int j,k; 8)j=0;k=0; 9)tl=new Test; 10)t2=new Test(j,k); 11)} 12)}
下列横线处应填写的语句是(  )。
import JaVa.awt.*;
public class FirstFrame extends Frame{
public static void main(String args[]){
FirstFrame fr=new FirstFrame("First container!");
fr.setsize(240,240);
fr.setBackground(Color.yellow);
}
public FirstFrame(String str){
super(str);
}
}
下列代码中,将引起一个编译错误的行是(  )。
1)public class Test{
2)int m,n;
3)public Test(){}
4)public Test(int a){m=a;)
5)public static void main(String args[]){
6)Test tl,t2;
7)int j,k;
8)j=0;k=0;
9)tl=new Test();
10)t2=new Test(j,k);
11)}
12)}

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?() 

Test.java程序代码如下: public class Test{ public static void main(String[] args){ System.out.println(args[1]); } } 以上程序编译后用java Test 2 3 4 5运行的输出结果是什么? ( )

1. class Pizza { 
2. java.util.ArrayList toppings; 
3. public final void addTopping(String topping) { 
4. toppings.add(topping);
5. } 
6. } 
7. public class PepperoniPizza extends Pizza { 
8. public void addTopping(String topping) { 
9. System.out.println(”Cannot add Toppings”); 
10. } 
11. public static void main(String[] args) { 
12. Pizza pizza = new PepperoniPizza(); 
13. pizza.addTopping(”Mushrooms”); 
14. } 
15. } 
What is the result?() 

11.public void genNumbers(){
12.ArrayList numbers=new ArrayList();
13.for(inti=0;i<10;i++){
14.intvalue=i*((int)Math.random());
15.IntegerintObj=newInteger(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 garbagec ollection?()
下面程序的输出结果是( )。 public class Sun { public static void main(String args[ ]) { int[] a=new int[11]; int[] p=new int[4]; int k=5; for (int i=1; i<=10; i++) a[i]=i; for(int i=1;i<=3;i++) p[i]=a[i*i]; for (int i=1; i<=3;i++) k=k+p [i]*2; System.out.println (k); } }
Java API ee支持线程的类或接口是(  )。
Ⅰ.java.lang.Thread
Ⅱ.java.lang.Runnable
Ⅲ.java.lang.ThreadGroup
IV.java.io.Serializable

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?() 

Given:  
11. static class A {  
12. void process() throws Exception { throw new Exception(); }  
13. }  
14. static class B extends A {  
15. void process() { System.out.println("B "); }  
16. }  
17. public static void main(String[] args) {  
18. A a = new B();  
19. a.process();  
20. }  
What is the result? ()

11. static class A { 
12. void process() throws Exception { throw new Exception(); } 
13. } 
14. static class B extends A { 
15. void process() { System.out.println(”B”); } 
16. } 
17. public static void main(String[] args) { 
18. new B().process(); 
19. } 
What is the result?() 

11. static classA { 
12. void process() throws Exception { throw new Exception(); } 
13. } 
14. static class B extends A { 
15. void process() { System.out.println(”B “); } 
16. } 
17. public static void main(String[] args) { 
18.A a=new B(); 
19. a.process(); 
20.} 
What is the result?() 

11.classA { 
12. public void process() { System.out.print(”A “); } } 
13. class B extends A { 
14. public void process() throws RuntimeException { 
15. super.process(); 
16. if (true) throw new RuntimeException(); 
17. System.out.print(“B”); }} 
18. public static void main(String[] args) { 
19. try { ((A)new B()).process(); } 
20. catch (Exception e) { System.out.print(”Exception “); } 
21. } 
What is the result?() 

11.classa { 
12. public void process() { System.out.print(”a,”); } } 
13. class b extends a { 
14. public void process() throws IOException { 
15. super.process(); 
16. System.out.print(”b,”); 
17. throw new IOException(); 
18. } } 
19. public static void main(String[] args) { 
20. try { new b().process(); } 
21. catch (IOException e) { System.out.println(”Exception”); } } 
What is the result?() 

已知AX=0BBCCH,CF=1,以下三条指令执行后,AX中内容是:()
OR AX,3
CLC
RCL AX,1

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?()()
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?()()
广告位招租WX:84302438

免费的网站请分享给朋友吧