Garbage Collections Questions and Answers
Garbage Collection in Java is a critical concept for memory management and performance optimization. This topic includes Java programming questions and answers related to JVM memory models, automatic garbage collection, and reference handling. Practicing garbage collection questions with answers helps learners prepare for TCS, Accenture, Infosys, and other software company interviews. A solid understanding of garbage collection enables developers to write efficient Java programs, reducing memory leaks and improving application stability.
Garbage Collections
Showing 10 of
32 questions
31. Which garbage collector is default in Java 8?
- Serial GC
- Parallel GC
- CMS GC
- G1 GC
32. Can we force garbage collection in Java?
- Yes, using System.forceGC()
- No, only request is possible
- Yes, using Runtime.forceGarbageCollection()
- Yes, using JVM.gc()