RT~~~希望高手指教。。给出答案最好说一下选择的原因.1.Which of the following statements are true? 
A.The automatic garbage collection of the JVM prevents programs from ever running out of memory 
B.A program can suggest that garbage collection be performed and force it 
C.Garbage collection is platform independent 
D.An object becomes eligible for garbage collection when all references denoting it are set to null.2.Which statements about Java code security are not true? 
A.The bytecode verifier loads all classes needed for the execution of a program. 
B.Executing code is performed by the runtime interpreter. 
C.At runtime the bytecodes are loaded, checked and run in an interpreter. 
D.The class loader adds security by separating the namespaces for the classes of the local file system from those imported from network sources.3.Which statement about the garbage collection mechanism are true? 
A.Garbage collection require additional programe code in cases where multiple threads are running. 
B.The programmer can indicate that a reference through a local variable is no longer of interest. 
C.The programmer has a mechanism that explicity and immediately frees the memory used by Java objects. 
D.The garbage collection mechanism can free the memory used by Java Object at explection time.4.public class X{
   public Object m(){
      Object o = new Float(3.14F);//line 3
      Object [] oa = new Object[1];//line 4
      oa[0] = o;//line 5
      o=null;//line 6
      return oa[0];//line 7
    }
}
When is the Float object, created in line 3,eligible for garbage collection?A.just after line 5. 
B.just after line 6 
C.just after line 7(that is,as the method returns) 
D.never in this method 5.Give the following method:
 public void method( ){
 String a,b;
 a=new String(“hello world”);
 b=new String(“game over”);
 System.out.println(a+b+”ok”);
 a=null;
 a=b;
 System.out.println(a);
 } 
In the absence of compiler optimization, which is the earliest point the object a refered is definitely elibile to be garbage collection.A.before line 5 
B.before line 6 
C.before line 7 
D.before line 9

解决方案 »

  1.   

    呃,,,蝌蚪文,,,questions 4   select  D never in this method
      

  2.   

    1.Which of the following statements are true?
    A.The automatic garbage collection of the JVM prevents programs from ever running out of memory
    不会每次都会防止的
    B.A program can suggest that garbage collection be performed and force it
    可以建议执行.不会强制执行
    C.Garbage collection is platform independent
    不是平台独立的
    D.An object becomes eligible for garbage collection when all references denoting it are set to null.
    正确答案..所有线程都没有对象引用2.Which statements about Java code security are not true?
    A.The bytecode verifier loads all classes needed for the execution of a program.
    B.Executing code is performed by the runtime interpreter.
    C.At runtime the bytecodes are loaded, checked and run in an interpreter.
    C应该是这个.哦C
    D.The class loader adds security by separating the namespaces for the classes of the local file system from thoseimported from network sources.3.Which statement about the garbage collection mechanism are true?
    A.Garbage collection require additional programe code in cases where multiple threads are running.多线程需要额外的代码吗?
    B.The programmer can indicate that a reference through a local variable is no longer of interest.
    标记..正确B
    C.The programmer has a mechanism that explicity and immediately frees the memory used by Java objects.
    肯定不会立即执行
    D.The garbage collection mechanism can free the memory used by Java Object at explection time.4.public class X{
      public Object m(){
          Object o = new Float(3.14F);//line 3
          Object [] oa = new Object[1];//line 4
          oa[0] = o;//line 5
          o=null;//line 6
          return oa[0];//line 7
        }
    }
    When is the Float object, created in line 3,eligible for garbage collection?A.just after line 5.
    B.just after line 6
    C.just after line 7(that is,as the method returns)
    D.never in this method
    这道题目不知道..应该是D吧..呵呵数组也是对象...引用类型的.既然返回了,就无法释放了哦5.Give the following method:
    public void method( ){
    String a,b;
    a=new String(“hello world”);
    b=new String(“game over”);
    System.out.println(a+b+”ok”);
    a=null;
    a=b;
    System.out.println(a);
    }
    In the absence of compiler optimization, which is the earliest point the object a refered is definitely elibile to be
    默认编译器,最早回收的对象应该是"hello world"这些吧...字符对象池...概念.AAAAAAAAA应该是A
    garbage collection.A.before line 5
    B.before line 6
    C.before line 7
    D.before line 9 
      

  3.   

    d
    c
    b
    d
    a
    打分吧...