Basic Java Interview Question and Answers
49. | How can we force the garbage collector to run? |
---|---|
Garbage collector can be run forcibly using "System.gc()" or "Runtime.gc()". | |
50. | What restrictions are placed on method overriding? |
---|---|
|
|
51. | What is a package? |
---|---|
A package stores a group of related classes and interfaces. They eliminate the conflicts in class names in different of classes. | |
52. | What is memory footprint? |
---|---|
When JVM needs more memory then it does the garbage collection, and sweeps all the memory which is not being used. | |