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 is meant by call by reference?

511


What is array class in java?

596


What is math floor in java?

473


Explain the difference between static and dynamic binding in java?

545


What is void class in java?

528






What is casting in java programming?

585


Can you use this() and super() both in a constructor?

522


What is the main function in java?

533


What is ‘is-a ‘ relationship in java?

590


How to compare two strings in java program?

674


How do you override a method in java?

537


State two differences between C and Java.

695


Why do we create threads in java?

583


Why set is used in java?

573


What happens if a constructor is declared private?

537