Can i write marker interfaces,if yes how can i?

Showing Answers 1 - 5 of 5 Answers

Ankur

  • Oct 25th, 2006
 

Mark interface marks the implenting class...

Didnt get this...

Pls explain.....

  Was this answer useful?  Yes

Sunil Pratap Singh

  • Nov 9th, 2006
 

Implementing a maker interface is an indication to the java execution environment to provide the class with the hidden functionality for which the interface has been developed. For example Serializable interface

If we implement Serializable interface which does not have any method in it, so is a marker interface. The execution environment takes care of serilaization of the instances of the class which implements the serializable interface. So we can say that corresponding to a maker interface java has provided some hidden functionality which has been plugged into the execution environment.

We can write marker interface but its functionality(hidden) have to be pluged into the execution environment which may to hindrance to java's platform independence

 

shashidhar reddy

  • Dec 1st, 2006
 

   Hi Sunil,

       can u briefly explain this.Is it possible to write userdefined marked interfaces

                           

  Was this answer useful?  Yes

yes you can write marker interface.
A marker interface is the one which doesn't have any methods declared in it e.g. Serializable etc.

Here you go as marker interface...............
interface thisIsAMarkerInterface
{
}


vinny

  Was this answer useful?  Yes

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