6What does System.gc() do?AForces immediate collection alwaysBSuggests that the JVM run the garbage collectorCDeletes all objectsDFrees stack memoryView AnswerDiscussWorkspaceReportSaveEasy
7Which method was historically called before an object is collected (now deprecated)?Afinalize()Bclose()Cdelete()Ddestroy()View AnswerDiscussWorkspaceReportSaveEasy
8When does an object become eligible for garbage collection?AWhen it is set to 0BOnly when System.gc() is calledCWhen no live reference can reach itDAs soon as a method returnsView AnswerDiscussWorkspaceReportSaveEasy
9Which JVM option sets the maximum heap size?A-XmxB-XX:MaxC-XssD-Xms onlyView AnswerDiscussWorkspaceReportSaveMedium
10Can garbage collection fix memory leaks caused by objects held in a static list?AYes, alwaysBOnly with System.gc()COnly in Java 8DNo — they are still reachableView AnswerDiscussWorkspaceReportSaveEasy