how a marker interface gets its functionality and when we
implements a marker interface how it got invoked

Answers were Sorted based on User's Feedback



how a marker interface gets its functionality and when we implements a marker interface how it got..

Answer / somasundar m

Marker interface are a design pattern which is used to mark
the classes for doing some specific actions. Marker
interface are just to mark the classes. For example
Serializable is a marker interface. So jvm looks for the
classes which are marked as serializable to serialize the
objects. It tells the compiler that the marked items
should be treated differently. Since it is a older design
pattern. Now a days Annotations has been introduced, so we
can replace the usage of marker interface with annotations.

Is This Answer Correct ?    10 Yes 1 No

how a marker interface gets its functionality and when we implements a marker interface how it got..

Answer / bhargavi

The marker interfaces would have got the functionalities
from the super class or interface . Marker interfaces are
called as tagged interfaces which wraps a specific
functionality with its name.It doesn't contains any method.

Is This Answer Correct ?    3 Yes 2 No

how a marker interface gets its functionality and when we implements a marker interface how it got..

Answer / yadav

Serializability of a class is enabled by the class implementing the java.io.Serializable interface. Classes that do not implement this interface will not have any of their state serialized or deserialized. All subtypes of a serializable class are themselves serializable. The serialization interface has no methods or fields and serves only to identify the semantics of being serializable.

Classes that require special handling during the serialization and deserialization process must implement special methods with these exact signatures:

private void writeObject(java.io.ObjectOutputStream out)
throws IOException
private void readObject(java.io.ObjectInputStream in)
throws IOException, ClassNotFoundException;

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Core Java Interview Questions

When throw keyword is used?

0 Answers  


how to make a un-checked exception as a checked exception one.

2 Answers  


Explain the Propertie sof class?

0 Answers  


what is the diff between Servletcontext and servletconfig?

5 Answers  


What is module in project?

0 Answers  






in a constructor what happen if u call super and this in the same class? i know that it is not possible to call both in the same one? if we call what will happen?

10 Answers   ITC Infotech,


Can a private method be declared as static?

0 Answers   Global Logic,


What is functional interface in java example?

0 Answers  


Define how objects are stored in java?

0 Answers  


Is JRE required to compile Java files ?

4 Answers   HCL,


How can u increase the heap size in the memory?

0 Answers   Infosys,


why applet doesn't have main? isn't possible a program with out main?

9 Answers   TCS,


Categories