This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Java in General 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 Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Marker Interface" Watch "Marker Interface" New topic
Author

Marker Interface

Saurabh Agrawal
Ranch Hand

Joined: Oct 07, 2003
Posts: 244
Hello friends ,
I am back here with my queries to be resolved by you.
Well i dont understand what is the significance of marker interface when there are no methos declaration in that ?
Could anyone highlight me the importance of marker interfaces ??
I hope you would resolve my query.This was one of the questions in the interview ..
Thanks,
Saurabh


Success is not doing extraordinary things but doing ordinary things extraordinarily well.
Chandra Bairi
Ranch Hand

Joined: Sep 12, 2003
Posts: 152
This is one of the very good questions asked. Marker interface does not have any methods. This is true. the basic thing is that when we implement a marker interface the java compiler notes that it has implemented a certain interface and it will try to assign some properties to the class that implemented it. Like if SingleThreadModel interface is implemented then there may be some variables which will get attached to the class and whenever the objects of these classes are accessed the variables which exist in the marker interface may come into picture. these will help in keeping the object accessed by the users one at a time as SingleThread model does. kindly correct if I am wrong.
regards,
shekar.


Thanks,
Shekar
mady sady
Greenhorn

Joined: Feb 25, 2009
Posts: 3
Marker interface is used by JVM to check instance. We can also create marker interface. Most of the time in interview it is asked.

For example : Serializable This is an interface which is compulsion to implement for serialization and it is checked during file read right.

For more details you can refer:
www.classiccoder.com
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13884
    
  10

Madhu, welcome to JavaRanch.

Please note that you are responding to a topic from 2004 - more than six years ago! The original poster is most likely not still waiting for an answer.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39578
    
  27
madhu sahu wrote:... For more details you can refer: www.classiccoder.com

So you ask a question elsewhere, then you answer it yourself, and now you link to it from here? What is that all about (ignoring the annoying color of your post for the moment)?


Ping & DNS - updated with new look and Ping home screen widget
Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

Ulf Dittmer wrote:
madhu sahu wrote:... For more details you can refer: www.classiccoder.com

So you ask a question elsewhere, then you answer it yourself, and now you link to it from here? What is that all about (ignoring the annoying color of your post for the moment)?


Maybe he is the owner of the classiccoder site! =P


[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18168
    
    8

Hebert Coelho wrote:Maybe he is the owner of the classiccoder site! =P


No joke... he's apparently the only one who ever posts there.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Marker Interface
 
Similar Threads
marker interface
Marker Interface doubt
Marker Interface
user defined marker Interface ?
Marker Interface