Problems With Finalizer

In Java, the finalize method has been part of the language since its early days, offering a mechanism to perform cleanup activities before an object is garbage collected. However, using finalizers has come under scrutiny due to several performance-related concerns. As of Java 9, the finalize method has been deprecated, and its use is highly... Continue Reading →

Synchronized method – Boy Friend Threads & Girl Friend Object

This post explains Java's synchronized methods, allowing only one thread to access a method at a time. It contrasts the behavior of non-synchronized and synchronized methods using an example involving multiple threads representing boyfriends meeting a girlfriend. The synchronized method ensures sequential execution, preventing threads from entering before the current one finishes.

Up ↑