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

Answer Posted / koti

Marker Interface:
Marker interface may be containing
methods,may not be containing methods.

Whenever any interface having a special behavior that type
of interfaces are called as marker interfaces (or) indicator
interface (or) tagged interface.

If interfaces not containing the methods, implementation
provided by the JVM.the given interfaces are not containing
the methods.
Ex: 1.java.lang.Serializable
2.java.lang.Cloneable
3.java.rmi.Remote
4.java.util.EventHandling
5.java.util.RandomAccess.

If interfaces containing methods then JVM not providing the
implementation ,expecting the implementation from the
programmer.

Ex: 1.java.lang.Runnable having the Run().
2.java.io.Externalizable having two methods those are
(a) writeExternal()
(b) readExternal()

In this Externalizable super class is Serializable.

Serializable not containing the methods but Externalizable
containing the methods.How can we say marker interface not
containing methods.

when super class serialized sub class also serialized.Where
as sub class is serialized super class members are serialized.

clone:
clone is duplicate collection of objects.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are data types in oop?

658


Which software is used for java programming?

643


Explain about public and private access specifiers?

637


How to reverse string in java?

720


what is an objects lock and which objects have locks? : Java thread

640






What is regex java?

667


What is difference between variable declaration and definition?

602


What is the purpose of void?

630


What is array class in java?

679


Can we use different return types for methods when overridden?

645


What is string substring?

663


Where to store local variables?

664


How do you check whether the list is empty or not in java?

605


What is the platform?

614


What is hashing principle in java?

649