A Line 16 B Line 17 C Line 18 D Line 19 E The object is NOT a candidate for

A line 16 b line 17 c line 18 d line 19 e the object

This preview shows page 96 - 99 out of 102 pages.

A. Line 16B. Line 17C. Line 18D. Line 19E. The object is NOT a candidate for garbage collection.Question 210Given:11. rbo = new ReallyBigObject();12. // more code here13. rbo = null;14. /* insert code here */Which statement should be placed at line 14 to suggest that the virtualmachine expend effort toward recycling the memory used by theobject rbo?A. System.gc();B. Runtime.gc();C. System.freeMemory();D. Runtime.getRuntime().growHeap();E. Runtime.getRuntime().freeMemory();Question 211Given:11. class Snoochy {12. Boochybooch;13. public Snoochy() { booch = new Boochy(this); }14. }15.16. class Boochy {
Background image
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 here25. }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 garbagecollection.C. Only the object referenced by snoog is eligible for garbagecollection.D. Only the object referenced by snooch is eligible for garbagecollection.E. The objects referenced by snooch and booch are eligible for garbagecollection.Question 212Given:1. public class GC {2. private Object o;3. private void doSomethingElse(Object obj) { o = obj; }4. public void doSomething() {5. Object o = new Object();6. doSomethingElse(o);7. o = new Object();8. doSomethingElse(null);9.o=null;10. }11. }When the doSomething method is called, after which line does theObject created in line 5 become available for garbage collection?A. Line 5B. Line 6C. Line 7D. Line 8E. Line 9F. Line 10Question 213Which two are true? (Choose two.)A. A finalizer may NOT be invoked explicitly.
Background image
B. The finalize method declared in class Object takes no action.C. super.finalize() is called implicitly by any overriding finalize method.D. The finalize method for a given object will be called no more thanonce by the garbage collector.E. The order in which finalize will be called on two objects is based onthe order in which the two objects became finalizable.Question 214A class games.cards.Poker is correctly defined in the jar file Poker.jar.A user wants to execute the main method of Poker on a UNIX systemusing the command:java games.cards.PokerWhat allows the user to do this?A. put Poker.jar in directory /stuff/java, and set the CLASSPATH toinclude /stuff/javaB. put Poker.jar in directory /stuff/java, and set the CLASSPATH toinclude /stuff/java/*.jarC. Put Poker.jar in directory /stuff/java, and set the CLASSPATH toinclude /stuff/java/Poker.jarD. put Poker.jar in directory /stuff/java/games/cards, and set theCLASSPATH to include /stuff/javaE. put Poker.jar in directory /stuff/java/games/cards, and set theCLASSPATH to include /stuffijava/*.jarF. put Poker.jar in directory /stuff/java/games/cards, and set theCLASSPATH to include /stuff/java/Poker.jarQuestion 215Click the Exhibit button.Given the fully-qualified class names:com.foo.bar.Dogcom.foo.bar.blatz.Bookcom.bar.Carcom.bar.blatz.SunWhich graph represents the correct directory structure for a JAR filefrom which those classes can be used by the compiler and JYM?
Background image
Image of page 99

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture