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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / srinivas

the interface doesn't have any methods called marker interface
But due to implement that interface the object contain some capability.
EX: Clonable

Cloning means we can create exatly duplicate object

Is This Answer Correct ?    0 Yes 0 No

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

Answer / kavya

It’s a kind of interface which has no method is known as marker interface. Serializable, Clonnable is the example of marker interface to create <a href="http://beyondcorner.com/create-own-marker-interface-in-java">Marker Interface in Java </a>
Use of Marker Interface:
Marker Interfaces are used to indicate something to compiler/JVM. If JVM see that a class is a object of Marker Interface then it will perform some special operation. Take an example with Serializable, Clonnable marker interface, if JVM see a Class is Serialized/Clonnable then It will do some special operation on it, similar way if JVM sees one Class is implemented custom marker interface which is created by ourself then the JVM do some special operation.

Is This Answer Correct ?    0 Yes 0 No

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

Answer / kavya

Use of marker interface in java

Marker Interfaces are used to indicate something to compiler/JVM. If JVM see that a class is a object of Marker Interface then it will perform some special operation. Take an example with Serializable, Clonnable marker interface, if JVM see a Class is Serialized/Clonnable then It will do some special operation on it, similar way if JVM sees one Class is implemented custom marker interface which is created by ourself then the JVM do some special operation. How it’d do the special operation

Is This Answer Correct ?    0 Yes 0 No

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

Answer / sai

Marker Interface is a interface which does not have methods
and also one more point is that it makes the method to
execute compulsory.Example Runnable Interface we call it as
a Marker Interface but as per the First Point it should not
be a Marker Interface but it contains a run() and when u r
extending the Thread Class it is making u to execute run()
Indirectly.

So my dear friends when u r argue abt some topic plz be
clear with it and then argue.

Is This Answer Correct ?    16 Yes 32 No

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

Answer / abirami

marker interface is a class in garbage collection and clone
is the bit wise copy of an object

Is This Answer Correct ?    9 Yes 63 No

Post New Answer

More Core Java Interview Questions

What is an array and a vector? How they different from each other?

4 Answers  


Can an arraylist be empty?

0 Answers  


what is actual real time using of oops concepts in projects(Interface,polymorphism.abstraction.........)

2 Answers  


Give some features of interface?

0 Answers  


difference between byte stream class and character stream class?

0 Answers  






What is finally and finalize in java?

0 Answers  


How is garbage collection controlled?

0 Answers  


What is the right data type to represent a price in java?

0 Answers  


How to add menushortcut to menu item?

0 Answers  


What is a java lambda expression?

0 Answers  


What is equals method in java?

0 Answers  


if am have 100 threads(for ex:T1,T2---T100) how we give priority to these threads and how the system excute these threads

2 Answers  


Categories