Marker interface in Java ?

Last updated:9/20/2020 7:42:36 PM

1 Answers

Prakash nidhi Verma
Prakash nidhi Verma

Marker interface in java :

It means we giving some extra functionality to the our class by extending than create a marker interface. Functionality will be different from marker interface to per interface .If JVM finds any user defined class was implemented any marker interface it will do some special operation on that object. 
In java we have the following main marker interfaces as shown below: 
1)Searilizable interface
2)Cloneable interface
3)Remote interface
4)ThreadSafe interface

Object x = 'mindstick';
if (x instanceof Serializable) {
}
writeObject(Serializable);

Happy Coding :)

Answer