A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Joined: Sep 19, 2006
Dec 10, 2006 23:29:00
How can i create my own marker interface?
Joined: Nov 29, 2005
Dec 11, 2006 00:07:00
Create a interface without any method and variable in that...
That makes the interface as marker.
though i guess that there is no formal defination of marker interface.
[ December 11, 2006: Message edited by: Rahul Bhattacharjee ]
Joined: Nov 16, 2005
Dec 11, 2006 01:59:00
Marker Interface will be used, when you want mark your Class saying it is serlizable or colneable?
Likewise you can create an Interface like Rahul said, If you have such a kind of requirement.
Prabhu Venkatachalam<br />SCJP 1.4,SCWCD 1.4<br />email@example.com
Jesper de Jong
Joined: Aug 16, 2005
Dec 11, 2006 02:59:00
Note that marker interfaces are an old "hack". If you are using
5.0 or newer you should use annotations instead of marker interfaces.
See for example
An Introduction to Java Annotations
Of Java Annotations
to learn what annotations are.
Java Beginners FAQ
JavaRanch SCJP FAQ
The Java Tutorial
Java SE 8 API documentation
I agree. Here's the link:
subject: Marker Interface
Marker Interface purpose
What is advantage of marker interface?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015