why marker interfaces are there in java

Answers were Sorted based on User's Feedback



why marker interfaces are there in java..

Answer / ravinder

When a class implements a marker interface, then the object
of that class is given with a special behavior. For example
if a class implements remote interface(available in
java.rmi.* package) object of that class acts as a Remote
Object. For this reason java provides Marker Interface.

Is This Answer Correct ?    7 Yes 2 No

why marker interfaces are there in java..

Answer / srinu

when class implements marker interface our class object
getting special behavoiur.
EX:-
suppose our class implements java.lang.Serializible
interface our class object getting special behaviour(our
class object converting java support format object to
network support)

Another Example our class implements java.rmi.Remote
interface our class object acts as Remote object.

Is This Answer Correct ?    3 Yes 0 No

why marker interfaces are there in java..

Answer / siva kumar g

Marker interfaces can create an environment.

Marker interfaces are used to specify that a class belongs
to a logical family or grouping - as quoted above,
Cloneable is used to indicate that a particular class can
be cloned, or Serializable is used to indicate that a
particular class can be serialized.

Is This Answer Correct ?    2 Yes 1 No

why marker interfaces are there in java..

Answer / maurya

an interface without any method is known as marker
interface. we use marker interface to actually mark for JVM
to distinguish that the class is belongs or subclass of ant
particular super class.
EX-->
we have an interface named serializable. there is a
condition that if you want to serialize your object u must
have to implements marker interface.
by doing this we just only inform JVM that my class is able
to be serialized. JVM detact it at run time by using Class
class methods.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Core Java Interview Questions

When we can access the static data member without creating the object what is the need of the object in java.

5 Answers   Airhub, ssinformatics,


why string constant pool in java

2 Answers   TCS,


What is ide with example?

0 Answers  


how to pass the parameters to applets?

1 Answers  


What is charat ()?

0 Answers  


How do you override a variable in java?

0 Answers  


What string is utf8?

0 Answers  


Does java support multiple inheritances?

0 Answers  


What is <> used for in java?

0 Answers  


What is abstraction in java?

0 Answers   Akamai Technologies,


Is list ordered in java?

0 Answers  


Explain the difference between jdk, jre, and jvm?

0 Answers  


Categories