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

Answer Posted / ramesh.m

1)By implementing for interface,our object can get some
ability such type interfaces called as "marker/ability/tag
interfaces".

Ex:
By implementing Serializable interface,our objects can able
to travel across network and can able to save the file
persistently.

2)If any interface does not contain any methods, it is
always called "marker interface".

Ex:
Serializable ,Clonable,RandomAccess,SingleThreadModel.

in these cases,JVM will provide required ability
automatically.

3)Even though interface contains methods by implementing
that interface if our objects will get some ability still we
can consider it as marker interface.

Ex:
Comparable [compareTo()method],Runnable[run() method] etc.

in these cases,required ability should be provided by
programmer.

Is This Answer Correct ?    9 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is string intern in java?

556


What is the use of arraylist in java?

531


What is logical variable?

516


Explain implementation and how is it different from conversion?

591


Detail discussions on JVM, memory management and garbage collector.

560






What are voids?

536


What are different access specifiers in java?

570


What is the definition of tree ?

593


How is final different from finally and finalize?

498


What is the difference between length and size in java?

501


What is a private class in java?

512


What is identifier with example?

580


What is the purpose of assert keyword used in jdk1.4.x?

568


What is a byte array?

593


What is qms certification?

524