What is Marker interface in java? and what is clone?

Answer Posted / alok kumar ranjan

Marker interface is tagged interface with no methods inside
it.clone means copy of an object.

The marker interfaces are used to provide certain
functionality to classes you code. Take for
instance the Cloneable interface. This interface is
implemented by the JVM itself and allows
copies of objects to be created without the developer having
to write code for this purpose.
User written marker interfaces can also be used for
inheritance purposes.Marker Interfaces are
used to mark the capability of a class as implementing a
specific interface at run-time.

Some examples of marker interfaces are :-
1) Serializable
2) Cloneable
3) RandomAccess
4) SingleThreadModel
5) EventListner

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different tags provided in jstl?

543


What is the difference between reader/writer and inputstream/output stream?

550


What is passing by reference in java?

533


Do you know how to reverse string in java?

578


What is the reflection?

555






How many threads can I run java?

535


Is oracle charging for java?

541


Explain different types of wrapper classes in java?

592


What is difference between protected and private?

522


What is a generic type?

552


What is method overriding in java ?

649


How do I type unicode?

523


Explain which of the following methods releases the lock when yield(), join(),sleep(),wait(),notify(), notifyall() methods are executed?

605


What is immutable in java?

536


How many bytes are a float?

501