Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is Marker Interface?

interface Marker
0
Posted

What is Marker Interface?

0

Marker Interfaces are giving specification to the JVM about the implementing classes. One of the features of the Java programming language is that it mandates a separation between interfaces (pure behavior) and classes (state and behavior). Interfaces are used in Java to specify the behavior of derived classes. Often you will come across interfaces in Java that have no behavior. In other words, they are just empty interface definitions. These are known as marker interfaces. Marker interfaces are also called “tag” interfaces since they tag all the derived classes into a category based on their purpose. Some examples of marker interfaces in the Java API include: – Java.lang.Cloneable A class implements the Cloneable interface to indicate to the Object.clone() method that it is legal for that method to make a field-for-field copy of instances of that class. java.io.Serializable Serialization is nothing but s saving the state of an object to persistent storage as byte stream. Serializabili

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123