Garbage Collections Questions and Answers

Practice Mode
Showing 10 of 32 questions
Q31
Which garbage collector is default in Java 8?
  • A Serial GC
  • B Parallel GC
  • C CMS GC
  • D G1 GC
Answer: Option B
Explanation: Parallel GC is default in Java 8.
Q32
Can we force garbage collection in Java?
  • A Yes, using System.forceGC()
  • B No, only request is possible
  • C Yes, using Runtime.forceGarbageCollection()
  • D Yes, using JVM.gc()
Answer: Option B
Explanation: We can only request, not force garbage collection.
Questions and Answers for Competitive Exams Various Entrance Test