• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Marker Interface

 
sahidul karim
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i create my own marker interface?
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Prabhu Venkatachalam
Ranch Hand
Posts: 502
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

hth,
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15278
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that marker interfaces are an old "hack". If you are using Java 5.0 or newer you should use annotations instead of marker interfaces.

See for example An Introduction to Java Annotations and Of Java Annotations to learn what annotations are.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic