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

Answer Posted / ajay tiwari

Marker interfaces are those interface which may contain any
method but they provide some special information to the JVM
about what type of class or object it can be.

EX. Cloneable is a marker interface with no method which
means but it provide information to the JVM that class's
object who implement it can be cloned.

Runnable is also a marker interface with a run() method
which provide the information to the JVM that class's
object which implement this is used as a thread.

while the collection interface doesn't provide any special
information to the JVM that's why it is not as a Marker
interface

Is This Answer Correct ?    33 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What modifiers are allowed for methods in an interface?

633


What is functional interface in java example?

526


what is the swingutilities.invokelater(runnable) method for? : Java thread

539


What is the scope or life time of instance variables?

649


What is oop in java?

518






What is a JAR file?

586


What data type is true or false?

567


What is a nested class?

584


What are the differences between the constructors and methods?

568


Explain about anonymous inner classes in java?

573


How to use Media tracker Class.

639


What is difference between this and super keyword?

508


What happens when a thread cannot acquire a lock on an object in java programming?

540


Is node a data type in java?

489


What is a string token?

532