Hey buddy.. can you please tell me about the use of marker
interface? And is there any link between marker interface
and factory methods?
Thanks in advance.
Answers were Sorted based on User's Feedback
Answer / namita
Marker Interface or sometimes called as Tagging interface
are empty interface which means it does not have any
methods. The use of the these interface is below
Like clonneable interface which is also a marker interface
when ur code implements clonneable interface the JVM will
come to know that you want to clone the object by calling
clone method(). Similalry serializable interface needs to
be implemented when you want to serialize the objects.
Their implementation is just to make aware the JVM.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / venkat
Marker Inferface doesnt consists any methods
it gives prior intemation to JVM to treat specially
Ex:Serialiazable
singleThread
| Is This Answer Correct ? | 0 Yes | 0 No |
What is difference between == equals () and compareto () method?
what is object deep copy and shallow copy and why it is required?
What will be the output of the program? public class Test { public static void main(String args[]) { ArrayList<String> list = new ArrayList<String>(); list.add("2"); list.add("3"); list.add("4"); list.add("5"); System.out.println("size :"+list.size()); for(int i=0;i<list.size();i++) { list.remove(i); } System.out.println("size after:"+list.size()); } }
What is the difference between numeric and integer?
What is the basic of java?
What is the use join() in Threads ?
What class is used to create Server side object?
Instead of writing Home, Remote Interfaces if i directly extends EJBObject to bean class what happens?
What are the interfaces defined by Java.lang package?
What is a parameter in a function?
What is the difference between jdk and jre?
what is difference between throw and throws in exception?