File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Marker Interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Marker Interface" Watch "Marker Interface" New topic
Author

Marker Interface

sahidul karim
Greenhorn

Joined: Sep 19, 2006
Posts: 28
How can i create my own marker interface?
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
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 ]

Rahul Bhattacharjee
LinkedIn - Blog
Prabhu Venkatachalam
Ranch Hand

Joined: Nov 16, 2005
Posts: 502

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,


Prabhu Venkatachalam<br />SCJP 1.4,SCWCD 1.4<br />prabhu.venkatachalam@gmail.com
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

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.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Marker Interface
 
Similar Threads
Marker Interface
Marker Interface purpose
What is advantage of marker interface?
marker interface
Java