网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
Which statements about the garbage collection are true?()
A

 The program developer must create a thread to be responsible for free the memory.

B

 The garbage collection will check for and free memory no longer needed.

C

 The garbage collection allow the program developer to explicity and immediately free the memory.

D

 The garbage collection can free the memory used java object at expect time.


参考答案

参考解析
解析: Java语言将内存分配和释放的工组交给了自己,程序员不必做这些工作,它提供一个系统级的线程跟踪每个内存的分配,在JVM的空闲处理中,垃圾收集线程将检查和释放不再使用的内存(即可以被释放的内存)。垃圾收集的过程在java程序的生存期中是自动的,不需要分配和释放内存,也避免了内存泄漏。可以调用System.gc()方法建议(suggest)JVM执行垃圾收集以使得可被释放的内存能立即被使用,当此方法返回的时候,JVM已经做了最大的努力从被丢弃的对象上回收内存空间。程序员不能指定收集哪些内存,一般而言也不用关心这个问题,除非是程序的内存消耗很大,特别是有很多临时对象时可以“建议“进行垃圾收集以提高可用内存。需要指出的是调用System.gc()方法不能保证JVM立即进行垃圾收集,而只能是建议,因为垃圾收集线程的优先级很低(通常是最低的)。
更多 “单选题Which statements about the garbage collection are true?()A  The program developer must create a thread to be responsible for free the memory.B  The garbage collection will check for and free memory no longer needed.C  The garbage collection allow the program developer to explicity and immediately free the memory.D  The garbage collection can free the memory used java object at expect time.” 相关考题
考题 1. class TestA {  2. TestB b;  3. TestA() {  4. b = new TestB(this);  5. }  6. }  7. class TestB {  8. TestA a;  9. TestB(TestA a) {  10. this.a = a;  11. }  12. }  13. class TestAll {  14. public static void main (String args[]) {  15. new TestAll().makeThings(); 16. // ...code continues on  17. }  18. void makeThings() {  19. TestA test = new TestA(); 20. }  21. }  Which two statements are true after line 15, before main completes?()A、 Line 15 causes a stack overflow.B、 An exception is thrown at runtime.C、 The object referenced by a is eligible for garbage collection.D、 The object referenced by b is eligible for garbage collection.E、 The object referenced by a is not eligible for garbage collection.F、 The object referenced by b is not eligible for garbage collection.

考题 How can you force garbage collection of an object?()A、 Garbage collection cannot be forced.B、 Call System.gc().C、 Call System.gc(), passing in a reference to the object to be garbage collected.D、 Call Runtime.gc().E、 Set all references to the object to new values(null, for example).

考题 You work as an application developer at Certkiller .com. Certkiller .com has been hired by a small local private school to develop a class library that will be used in an application named ManageAttendance for the purpose of managing student records.You are responsible for developing this class library. Certkiller .com has instructed you to create a collection in the application to store learners’ results. The school has informed you that they currently only have seven learners, but that this value will triple in the following year. Due to the limited resources, you need to ensure that the collection you create consumes a minimum amount of resources. What should you use to create the collection?()A、 The HybridDictionary collection class.B、 The HashTable collection class.C、 The ListDictionary collection class.D、 The StringCollection collection class.

考题 12. void start() {  13. A a = new A();  14. B b = new B();  15. a.s(b);  16. b = null;  17. a = null;  18. System.out.println(“start completed”); 19. }  When is the B object, created in line 14, eligible for garbage collection?()  A、 After line 16.B、 After line 17.C、 After line 18 (when the methods ends).D、 There is no way to be absolutely certain.E、 The object is NOT eligible for garbage collection.

考题 Which statements describe guaranteed behavior of the garbage collection and finalization mechanisms?()  A、Objects are deleted when they can no longer be accessed through any reference.B、The finalize() method will eventually be called on every object.C、The finalize() method will never be called more than once on an object.D、An object will not be garbage collected as long as it is possible for an active part of the program to access it through a reference.E、The garbage collector will use a mark and sweep algorithm.

考题 Which statement is true about XpauseTarget in Oracle JRockit JVM ? ()A、 This option is supported by all type of Garbage collection modes.B、 This option is only supported by Generational Garbage Collection mode.C、 This option is only supported by Mark and Sweep Garbage Collection mode.D、 This option is only supported by Dynamic Garbage Collection mode.

考题 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.

考题 Which statements about the garbage collection are true?() A、 The program developer must create a thread to be responsible for free the memory.B、 The garbage collection will check for and free memory no longer needed.C、 The garbage collection allow the program developer to explicity and immediately free the memory.D、 The garbage collection can free the memory used java object at expect time.

考题 Which of these statements concerning the collection interfaces are true?()  A、Set extends Collection.B、All methods defined in Set are also defined in Collection.C、List extends Collection.D、All methods defined in List are also defined in Collection.E、Map extends Collection.

考题 11. class Snoochy {  12. Boochybooch;  13. public Snoochy() { booch = new Boochy(this); }  14. }  15.  16. class Boochy {  17. Snoochy snooch;  18. public Boochy(Snoochy s) { snooch = s; }  19. }  And the statements:  21. public static void main(String[] args) {  22. Snoochy snoog = new Snoochy();  23. snoog = null;  24. // more code here  25. }  Which statement is true about the objects referenced by snoog, snooch, and booch immediately after line 23 executes?() A、 None of these objects are eligible for garbage collection.B、 Only the object referenced by booch is eligible for garbage collection.C、 Only the object referenced by snoog is eligible for garbage collection.D、 Only the object referenced by snooch is eligible for garbage collection.E、 The objects referenced by snooch and booch are eligible for garbage collection.

考题 class A {  }  class Alpha {  private A myA = new A();  void dolt( A a ) {  a = null;  }  void tryIt() {  dolt( myA );  }  }  Which two statements are correct?()  A、 There are no instanced of A that will become eligible for garbage collection.B、 Explicitly setting myA to null marks that instance to be eligible for garbage collection.C、 Any call on tryIt() causes the private instance of A to be marked for garbage collection.D、 Private instances of A become eligible for garbage collection when instances of Alpha become eligible for garbage collection.

考题 Oracle JRockit JVM uses -Xns option to set nursery size when the generational garbage collection mode is used.  Which two JVM properties are affected by changing its size ?()A、 compaction ratio limitB、 garbage collection frequencyC、 garbage collection timesD、 fragmentation heap size

考题 单选题According to the passage, which of the following statements is TRUE?A The American ship eventually found a port and dumped its garbage before it returned home.B Throwaway societies don’t need to transport their refuse and garbage to incinerator because they have a lot of space to put them.C The wandering ship with garbage reflected the fact that garbage problem became very serious.D The huge populations of rats swarm through poor neighborhood in many Western European countries because the garbage is thrown into the open dumps.

考题 单选题11.class Snoochy{ 12.Boochybooch; 13.public Snoochy(){booch=newBoochy(this);} 14.} 15. 16.class Boochy{ 17.Snoochy snooch; 18.public Boochy(Snoochys){snooch=s;} 19.} And the statements: 21.public static void main(String[]args){ 22.Snoochy snoog=new Snoochy(); 23.snoog=null; 24.//more code here 25.} Which statement is true about the objects referenced by snoog,snooch,and booch immediately after line 23 executes?()A None of these objects are eligible for garbage collection.B Only the object referenced by booch is eligible for garbage collection.C Only the object referenced by snoog is eligible for garbage collection.D Only the object referenced by snooch is eligible for garbage collection.E The objects referenced by snooch and booch are eligible for garbage collection.

考题 单选题Given: 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 19

考题 单选题You work as an application developer at Certkiller .com. Certkiller .com has been hired by a small local private school to develop a class library that will be used in an application named ManageAttendance for the purpose of managing student records.You are responsible for developing this class library. Certkiller .com has instructed you to create a collection in the application to store learners’ results. The school has informed you that they currently only have seven learners, but that this value will triple in the following year. Due to the limited resources, you need to ensure that the collection you create consumes a minimum amount of resources. What should you use to create the collection?()A  The HybridDictionary collection class.B  The HashTable collection class.C  The ListDictionary collection class.D  The StringCollection collection class.

考题 单选题11. class Snoochy {  12. Boochybooch;  13. public Snoochy() { booch = new Boochy(this); }  14. }  15.  16. class Boochy {  17. Snoochy snooch;  18. public Boochy(Snoochy s) { snooch = s; }  19. }  And the statements:  21. public static void main(String[] args) {  22. Snoochy snoog = new Snoochy();  23. snoog = null;  24. // more code here  25. }  Which statement is true about the objects referenced by snoog, snooch, and booch immediately after line 23 executes?()A  None of these objects are eligible for garbage collection.B  Only the object referenced by booch is eligible for garbage collection.C  Only the object referenced by snoog is eligible for garbage collection.D  Only the object referenced by snooch is eligible for garbage collection.E  The objects referenced by snooch and booch are eligible for garbage collection.

考题 单选题Which statement is TRUE().A You need not keep a record of ground garbage dumped into the sea more than 25 miles offshoreB You must keep a record of garbage discharged in port to a shore facilityC You need not keep a record of garbage incinerated on the shipD You must keep a record of the approximate weight of the garbage dumped

考题 多选题Which statements describe guaranteed behavior of the garbage collection and finalization mechanisms?()AObjects are deleted when they can no longer be accessed through any reference.BThe finalize() method will eventually be called on every object.CThe finalize() method will never be called more than once on an object.DAn object will not be garbage collected as long as it is possible for an active part of the program to access it through a reference.EThe garbage collector will use a mark and sweep algorithm.

考题 多选题Which of these statements concerning the collection interfaces are true?()ASet extends Collection.BAll methods defined in Set are also defined in Collection.CList extends Collection.DAll methods defined in List are also defined in Collection.EMap extends Collection.

考题 单选题Given:   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 19B  The object is NOT a candidate for garbage collection.C  Line 17D  Line 16E  Line 18

考题 单选题Which statements about the garbage collection are true?()A  The program developer must create a thread to be responsible for free the memory.B  The garbage collection will check for and free memory no longer needed.C  The garbage collection allow the program developer to explicity and immediately free the memory.D  The garbage collection can free the memory used java object at expect time.

考题 单选题Which statement regarding garbage disposal is correct?()A Records for ground garbage disposal are not required when disposal into the sea occurs more than 25 miles offshoreB Discharging or transfer of garbage while in port to a shore facility must he recordedC Maintaining records for the incineration of garbage aboard ship is not requiredD The recording of garbage disposal should include the approximate weight

考题 多选题1. class TestA {  2. TestB b;  3. TestA() {  4. b = new TestB(this);  5. }  6. }  7. class TestB {  8. TestA a;  9. TestB(TestA a) {  10. this.a = a;  11. }  12. }  13. class TestAll {  14. public static void main (String args[]) {  15. new TestAll().makeThings(); 16. // ...code continues on  17. }  18. void makeThings() {  19. TestA test = new TestA(); 20. }  21. }  Which two statements are true after line 15, before main completes?()ALine 15 causes a stack overflow.BAn exception is thrown at runtime.CThe object referenced by a is eligible for garbage collection.DThe object referenced by b is eligible for garbage collection.EThe object referenced by a is not eligible for garbage collection.FThe object referenced by b is not eligible for garbage collection.

考题 单选题How can you force garbage collection of an object?()A  Garbage collection cannot be forced.B  Call System.gc().C  Call System.gc(), passing in a reference to the object to be garbage collected.D  Call Runtime.gc().E  Set all references to the object to new values(null, for example).

考题 多选题Oracle JRockit JVM uses -Xns option to set nursery size when the generational garbage collection mode is used.  Which two JVM properties are affected by changing its size ?()Acompaction ratio limitBgarbage collection frequencyCgarbage collection timesDfragmentation heap size

考题 单选题Which statement is true about XpauseTarget in Oracle JRockit JVM ? ()A  This option is supported by all type of Garbage collection modes.B  This option is only supported by Generational Garbage Collection mode.C  This option is only supported by Mark and Sweep Garbage Collection mode.D  This option is only supported by Dynamic Garbage Collection mode.

考题 单选题12. void start() {  13. A a = new A();  14. B b = new B();  15. a.s(b);  16. b = null;  17. a = null;  18. System.out.println(“start completed”); 19. }  When is the B object, created in line 14, eligible for garbage collection?()A  After line 16.B  After line 17.C  After line 18 (when the methods ends).D  There is no way to be absolutely certain.E  The object is NOT eligible for garbage collection.