Explain the purpose of garbage collection that the JVM uses

Explain the purpose of garbage collection that the JVM uses.

The essential purpose of garbage collection is to reclaim the memory space that was occupied by the objects that are no longer required for the application. Garbage collection is done in java by a program called garbage collector. An object in the application is subjected to garbage collected when it is unreachable to the application.

Explain the purpose of garbage collection that the JVM uses.

Garbage collection in Java identifies and discards the objects that are no longer needed by a program so that their resources can be reclaimed and reused. A Java object is subject to garbage collection when it becomes unreachable to the program in which it is used. The finalize() method is called by garbage collector when it determines no more references to the object exists.
Explain how to read a line of input at a time
Input from the console is read from the System.in object and is then wrapped by an InputStreamReader which reads one character at a time......
How does Java handle integer overflows and underflows?
If a type exceeds a range of a type, it results in an overflow...
Difference between Integer and int in java
int is one of the primitive datatypes in Java. The Integer class wraps a value of the primitive type int in an object....
Post your comment