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
Explain about field hiding in java?
What does those terms actually mean included in the j.d.k i.6?
What are the default and parameterized constructors?
Is void a wrapper class?
What is number data type in java?
What are operators and its types?
What is scope of a variable?
What does the “static” keyword mean? Can you override private or static method in java?
What does string [] args mean?
Can a class be private or protected in java?
What are java threads?
What are different types of constants?
What is the protected method modifier?
When throw keyword is used?
How do you find the maximum number from an array without comparing and sorting?