Which marker interface in java is having methods in it

Showing Answers 1 - 10 of 10 Answers

kirankumar.k

  • Oct 13th, 2006
 

Runnable interface having run() method

  Was this answer useful?  Yes

shashidhar reddy

  • Dec 1st, 2006
 

   Hi kiran,

         why runnable interface has been declared as marked interface

               and has the method run()

  Was this answer useful?  Yes

suryainv

  • Jul 13th, 2007
 

Marker interface is a tag interface
The sub classes of this type of interfaces are identified as the classes pertaining to a particular heirarchy which are having identical charactrestics:
It indicates the ability of a class such as Serializable, Remotely accessible, Clonnable, Observable, Runnable etc
How a function can identify that a particular class instance is passed as argument into it be verified is an instance of valid class class heirarchy?
That means how to acheive compile time safe type casting?
Provided if the argument passed in the method is verified and found if the class is an instanceof a particular class accept it, otherwise NO.

Note:
Not only the interfaces which are not having methods are called as Marker interfaces
There are Marker interfaces with function as well
But interface which doesn't have any method will only be used for marking
and some interafces with methods also does the same

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions