what is use of marker interface? give me good example?
Answers were Sorted based on User's Feedback
Answer / aravind
In java language programming, interfaces with no methods are
known as marker interfaces. Marker interfaces are
Serializable, Clonable, SingleThreadModel, Event listener.
Marker Interfaces are implemented by the classes or their
super classes in order to add some functionality.
Suppose the interface Clonable is neither implemented by a
class named Myclass nor it's any super class, then a call to
the method clone() on Myclass's object will give an error.
This means, to add this functionality one should implement
the Clonable interface. While the Clonable is an empty
interface but it provides an important functionality.
| Is This Answer Correct ? | 10 Yes | 6 No |
Answer / devendra.m
Marker interface is a interface,in which that,it doesn't
have any methods...just which is giving mark to the run time
environment.
clonable,serializable,singleThreadModel are marker interfaces.
| Is This Answer Correct ? | 1 Yes | 0 No |
What is a function argument in java?
What is a protected void?
Does a class inherit the constructor of its super class?if it does, how can you hide that constructor? if it doesnot how can you call it from the sub class?
can we write a program with out a class in core java?
If you are given the name of the function at run time how will you invoke the function?
What is multi level inheritance in java?
Can a class declared as private be accessed outside it’s package?
what is the use of finalize()Method please explain with an example
what is inner class in java?
Difference between start() and run() method of thread class?
class A{ class B{ } } in which name u save the file,its the program compile?
Can you override static method in java?