For Programmers: Free Programming Magazines  


Home > Archive > Java Help > July 2006 > Marker Interface









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Marker Interface
thisisramesh@gmail.com

2006-07-21, 4:01 am

Is it possible to create a marker interface by a user ? If possible,
how? If it is not possible, Why?

Ingo R. Homann

2006-07-21, 4:01 am

Hi,

thisisramesh@gmail.com wrote:
> Is it possible to create a marker interface by a user ? If possible,
> how? If it is not possible, Why?


Is this a question from a test?

Do you know, what a marker interface is? If yes, than the answer to the
question is obvious!

Or do you want to know, what a marker interface is? A marker interface
is an interface that does not contain any methods.

Or do you want to know, how a marker interface is used?
....

Ciao,
Ingo

Ramsehboya

2006-07-21, 4:01 am

Hi,
I know what is marker interface and how it is usefull.Clonable and
Serializable are the examples for marker interface.

what is the similarities between these two.Is it possible to
define our own marker interface.

Bye,
Ramesh.


Ingo R. Homann wrote:

> Hi,
>
> thisisramesh@gmail.com wrote:
>
> Is this a question from a test?
>
> Do you know, what a marker interface is? If yes, than the answer to the
> question is obvious!
>
> Or do you want to know, what a marker interface is? A marker interface
> is an interface that does not contain any methods.
>
> Or do you want to know, how a marker interface is used?
> ...
>
> Ciao,
> Ingo


Ingo R. Homann

2006-07-21, 4:01 am

Hi,

Although I am still not convinced that this is a test...:

Ramsehboya wrote:
> Hi,
> I know what is marker interface and how it is usefull.Clonable and
> Serializable are the examples for marker interface.
>
> what is the similarities between these two.


The similarities are that they both do not define any method. Nothing else.

> Is it possible to
> define our own marker interface.


Hmm, do you think, you can define an interface which does not have any
method? If you *really* do not know the answer, try to compile this:

interface MyMarkerInterface {}

Ciao,
Ingo


Tony Morris

2006-07-23, 8:00 am

On Fri, 21 Jul 2006 00:12:55 -0700, Ramsehboya wrote:

> I know what is marker interface and how it is usefull.Clonable and
> Serializable are the examples for marker interface.
>
> what is the similarities between these two.Is it possible to
> define our own marker interface.


Similarities? They are both defective (implied by any
non-composite interface that declares no operations). Yes it is possible
to write your own form of this language defect.

--
Tony Morris
http://tmorris.net/


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com