Garbage collection cannot be forced.
Call System.gc().
Call System.gc(), passing in a reference to the object to be garbage collected.
Call Runtime.gc().
Set all references to the object to new values(null, for example).
第1题:
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?()
第2题:
What allows the programmer to destroy an object x?()
第3题:
Which statements describe guaranteed behavior of the garbage collection and finalization mechanisms?()
第4题:
Which statements about the garbage collection are true?()
第5题:
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You add a ListBox control to the application. The ListBox control is data-bound to an instance of a custom collection class of the Product objects named ProductList. The number of items of the data-bound collection is fixed. However, users can modify the properties of each of the Product objects in the collection. You need to ensure that changes made on the Product objects are automatically reflected in the ListBox control. What should you do?()
第6题:
None of these objects are eligible for garbage collection.
Only the object referenced by booch is eligible for garbage collection.
Only the object referenced by snoog is eligible for garbage collection.
Only the object referenced by snooch is eligible for garbage collection.
The objects referenced by snooch and booch are eligible for garbage collection.
第7题:
Just after line 5
Just after line 6
Just after line 7 (that is, as the method returns)
Never in this method.
第8题:
Line 19
The object is NOT a candidate for garbage collection.
Line 17
Line 16
Line 18
第9题:
Garbage collection cannot be forced.
Call System.gc().
Call System.gc(), passing in a reference to the object to be garbage collected.
Call Runtime.gc().
Set all references to the object to new values(null, for example).
第10题:
The program developer must create a thread to be responsible for free the memory.
The garbage collection will check for and free memory no longer needed.
The garbage collection allow the program developer to explicity and immediately free the memory.
The garbage collection can free the memory used java object at expect time.
第11题:
After line 16.
After line 17.
After line 18 (when the methods ends).
There is no way to be absolutely certain.
The object is NOT eligible for garbage collection.
第12题:
Install a new domain controller. Install Active Directory from media by using the most recent backup. Manually initiate replication.
Decrease the garbage collection interval. Perform a nonauthorative restoration of Active Directory by using the most recent backup.
Perform a nonauthorative restoration of Active Directory by using the most recent backup. Authoritatively restore the user object that was deleted.
Re-create a user object that has the same user principal name (UPN) as the user object that was deleted. Authoritatively restore this user object.
第13题:
How can you force garbage collection of an object?()
第14题:
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?()
第15题:
Which statement is true about XpauseTarget in Oracle JRockit JVM ? ()
第16题:
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 ?()
第17题:
Just after line 5.
Just after line 6.
Just after line 7.
Just after line 8(that is, as the method returns).
第18题:
x.delete()
x.finalize()
Runtime.getRuntime().gc()
Explicitly setting the object’s reference to null.
Ensuring there are no references to the object.
Only the garbage collection system can destroy an object.
第19题:
This option is supported by all type of Garbage collection modes.
This option is only supported by Generational Garbage Collection mode.
This option is only supported by Mark and Sweep Garbage Collection mode.
This option is only supported by Dynamic Garbage Collection mode.
第20题:
Line 15 causes a stack overflow.
An exception is thrown at runtime.
The object referenced by a is eligible for garbage collection.
The object referenced by b is eligible for garbage collection.
The object referenced by a is not eligible for garbage collection.
The object referenced by b is not eligible for garbage collection.
第21题:
Line 16
Line 17
Line 18
Line 19
第22题:
There are no instanced of A that will become eligible for garbage collection.
Explicitly setting myA to null marks that instance to be eligible for garbage collection.
Any call on tryIt() causes the private instance of A to be marked for garbage collection.
Private instances of A become eligible for garbage collection when instances of Alpha become eligible for garbage collection.
第23题:
Objects are deleted when they can no longer be accessed through any reference.
The finalize() method will eventually be called on every object.
The finalize() method will never be called more than once on an object.
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.
The garbage collector will use a mark and sweep algorithm.
第24题:
None of these objects are eligible for garbage collection.
Only the object referenced by booch is eligible for garbage collection.
Only the object referenced by snoog is eligible for garbage collection.
Only the object referenced by snooch is eligible for garbage collection.
The objects referenced by snooch and booch are eligible for garbage collection.