10. public Object m() { 11. Object o = new Float(3.14F); 12. Object [] oa = new Object[1]; 13. oa[0] = o; 14. o = null; 15. return oa[0]; 16. } When is the Float object, created in line 11, eligible for garbage collection?()
相似题目
-
11. public static void main(String[] args) { 12. Object obj = new Object() { 13. public int hashCode() { 14. returns 42; 15. } 16. }; 17. System.out.println(obj.hashCode()); 18. } What is the result? ()
-
package geometry; public class Hypotenuse { public InnerTriangle it = new InnerTriangle(); class InnerTriangle { public int base; public int height; } } Which is true about the class of an object that can reference the variable base? ()
-
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?()()
-
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?()
-
1.public class Test { 2.public static void main (String args[]) { 3.class Foo { 4.public int i = 3; 5.} 6.Object o = (Object) new Foo(); 7.Foo foo = (Foo)o; 8.System.out.printIn(foo. i); 9. } 10.} What is the result?()
-
Given: 11. public static void main(String[] args) { 12. Object obj = new int[] { 1, 2, 3 }; 13. int[] someArray = (int[])obj; 14. for (int i : someArray) System.out.print(i + " "); 15. } What is the result? ()
-
11. public void someMethod(Object value) { 12. // check for null value .... 20. System.out.println(value.getClass()); 21. } What, inserted at line 12, is the appropriate way to handle a null value?()
-
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.public void service(ServletRequest request, 11.ServletResponse response) { 12.ServletInputStream sis = 13.// insert code here 14.} Which retrieves the binary input stream on line 13?()
-
1. public class X { 2. public static void main (String[]args) { 3. int [] a = new int [1] 4. modify(a); 5. System.out.printIn(a[0]); 6. } 7. 8. public static void modify (int[] a) { 9. a[0] ++; 10. } 11. } What is the result?()
-
Given 11.public interface Status { 12./* insert code here */ int MY_VALUE = 10; 13.} Which three are valid on line 12?()
-
11.public static void main(String[]args){ 12.Object obj=new int[]{1,2,3}; 13.int[] someArray=(int[])obj; 14.for(inti:someArray)System.out.print(i+"") 15.} What is the result?()
-
11. public static void main(String[] args) { 12. Object obj =new int[] { 1,2,3 }; 13. int[] someArray = (int[])obj; 14. for (int i: someArray) System.out.print(i +“ “) 15. } What is the result? ()
-
10. class Nav{ 11. public enum Direction { NORTH, SOUTH, EAST, WEST } 12. } 13. public class Sprite{ 14. // insert code here 15. } Which code, inserted at line 14, allows the Sprite class to compile?()
-
1. public class Boxer1 { 2. Integer i; 3. int x; 4. public Boxer1(int y) { 5. x=i+y; 6. System.out.println(x); 7. } 8. public static void main(String[] args) { 9. new Boxer1(new Integer(4)); 10. } 11. } What is the result?()
-
1. public class X ( 2. public object m () { 3. object o = new float (3.14F); 4. object [] oa = new object [1]; 5. oa[0]= o; 6. o = null; 7. return oa[0]; 8. } 9. } When is the float object created in line 3, eligible for garbage collection?()
-
11. public interface Status { 12. /* insert code here */ int MY_VALUE = 10; 13. } Which three are valid on line 12?()
-
1. public class test ( 2. public static void main(string args[]) { 3. int 1= 0; 4. while (i) { 5. if (i==4) { 6. break; 7. } 8. ++i; 9. } 10. 11. } 12. ) What is the value of i at line 10?()
-
您写了下面这段代码 public delegate void FaxDocs(object sender, FaxArgs args); 您需要创建一个事件去调用FaxDocs,您应该使用哪个代码片段?()
-
public class X { public object m () { object o = new float (3.14F); object oa = new object [1]; oa[0]= o; o = null; return oa[0]; } } When is the float object created in line 3, eligible for garbage collection?()
-
public class Test { public static void main (String args) { class Foo { public int i = 3; } Object o = (Object) new Foo(); Foo foo = (Foo)o; System.out.printIn(foo. i); } } What is the result?()
-
读代码:public class Test {public static void main (String args[]) {class Foo {public int i = 3;}Object o = (Object) new Foo();Foo foo = (Foo)o;System.out.println(foo.i);}}结果是:
-
以下代码的调试结果为?1: public class Q102: {3: public static void main(String[] args)4: {5: int i = 10;6: int j = 10;7: boolean b = false;8:9: if( b = i == j)10: System.out.println(\True\);11: else12: System.out.println(\False\);13: }14: }
-
用下面那个代码代替程序标注的【代码】会导致编译错误?public class E{public static void main(String args[]){int m=10,n=0;if(【代码】){System.out.println(“Hello”);}}}()
推荐题目
- 韦伯将统治结构区分为三种典型类型,分别是()。
- 关于HIV的初筛试验的描述,正确的是()
- 5个月男孩,母乳喂养,平时易感冒,曾患肺炎3次,哭闹后唇发绀,初步检查结果:发育营养欠佳,胸骨左缘第3~4肋可闻及Ⅲ~Ⅳ/Ⅵ级收缩期杂音,P2亢进,胸片示肺动脉段明显突出,左、右心室增大。欲判断患儿属于哪一类型的先天性心脏病,首先应采用的最简便的无创性检查是()
- 男,16岁,1个月前剧烈活动后出现一次肉眼血尿,未治疗血尿停止。近2周来反复出现上述症状,无其他不适。查体未见明显异常。尿常规检查:红细胞15~20/HP,白细胞2~4/HP。B超检查提示:右肾盂上部可见3cm×2cm不规则形的不均质回声光团,肾上盏限局性积液。手术方式应选择()
- 增强传热效率的措施有哪些?
- 血清TSH测定的临床意义()。
- 下列对于鸟类的叙述,正确的是()。
- 荚膜是细菌的特殊结构,它具有很多功能,其中最重要的功能是()
- 下列哪项不符合不能结婚的原则()
- “颁朔”的含义是颁诏宣旨。()