What  is marker interface in java?

Marker interfaces are interfaces that do not contain any methods or fields. They are also known as tagging interfaces. The purpose of a marker interface is to provide runtime type information about objects. This allows the compiler and JVM to have more information about the object. Here is an example of a marker interface: Some examples of marker … Read more

Serialization in Java and Serializable Interface use

In this tutorial we will learn what is serialization in java and how do we achieve it with use of serializable interface.

How to write our own marker interface in Java?

A marker interface in Java does not contain any methods. Java provides built-in marker interfaces such as Serializable, Cloneable, and EventListener, which the JVM recognizes. Although we can create our own marker interfaces, they are unrelated to the JVM. Instead, we can incorporate checks using the instanceof operator to achieve similar functionality. Create the empty … Read more