aspose 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
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: 14338
    
  22

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 8 API documentation
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Marker Interface