Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is marker interface? [duplicate]

Tags:

java

Possible Duplicate:
What is the use of marker interfaces in Java?

What is the use of extending marker interface.

like image 321
Rajesh Avatar asked Sep 17 '26 01:09

Rajesh


2 Answers

A marker interface is exactly that: A means of marking that a class is or does certain things, even if those things are not expressed as actual methods. Marker interfaces date from very early on; these days while you might use one, you might also look at using annotations instead.

like image 79
T.J. Crowder Avatar answered Sep 18 '26 13:09

T.J. Crowder


It is an interface with no methods. It is just used to "mark" Java classes which support a certain functionality like Serializable and Cloneable.

like image 20
Darin Dimitrov Avatar answered Sep 18 '26 14:09

Darin Dimitrov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!