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 is garbage collection? Can it be forced to run?

543


Why we used vector class?

631


What are meta-annotations?

553


What is OOP Language?

630


Can we execute java program without main method?

524






What is nan inf?

507


What are the advantages of java over C++?

719


What are methods in java?

540


what methods would you overwrite in java.lang.object class?

566


What is a list in java?

508


How many types of array are there?

550


When should you use arraylist and when should you use linkedlist?

496


Why java is object oriented?

592


What is the difference between serializable and externalizable interface?

570


Assume a thread has lock on it, calling sleep() method on that thread will release the lock?

627