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 udp in java?

640


Why is method overloading not possible by changing the return type in java?

679


What is meant by overloading?

689


What are different access specifiers in java? Explain

734


Is java code slower than native code?

639






What happens if an exception is throws from an object's constructor?

733


What is ternary operator in java?

689


What are functions in java?

579


Can we overload run() method in java?

695


what is ststic with example

1687


Is main a keyword in java?

632


Why is it called buffering?

688


What is the base class of all exception classes?

675


What is array in java?

630


What is method with example?

665