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 does business logic mean?

742


Is java programming easy?

728


What is entry set in java?

730


Is null keyword in java?

714


If goto and const is reserve words than why it is not work in java?

1747


What is a byte string?

806


How many threads does a core java have?

762


How to create an interface?

817


Can we inherit a class with private constructor?

785


What is difference between throw and throws ?

843


Is a class an object?

774


What are the advantages of user defined functions?

738


Define packages in java?

770


What’s the difference between unit, integration and functional testing?

816


What is the maximum size of array in java?

721