Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Marker interface means , interface which has no methods.Then
what is the necessity of its usage.I read "it tells the
compiler that it should be treated differently ". "It is
used to store state of an object". But still am not
clear.Please explain clearly.

Answer Posted / pratap jadaun

Marker interface means, interface which has no methods. Then
what is the necessity of its usage. I read "it tells the
compiler that it should be treated differently ".

but the marker interface is not only
used to store state of an object

below given list of marker interfaces

- java,lang.Cloneable
- java,io.Serializable
-java.util.EventListener
....

these are marker interfaces in java and each interface is
used for different purpose

A class implements the Cloneable interface to indicate to
the Object.clone() method that it is legal for that method
to make a field-for-field copy of instances of that class.


"Serializable is used to store state of an object".

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the name of the java compiler?

1004


What is the syntax and characteristics of a lambda expression?

980


Can you override static methods?

897


What is object-oriented paradigm?

1006


Which class cannot be a subclass in java?

953


What is variable explain?

959


Explain about fail safe iterators in java?

962


How does regex work?

907


What are the different types of data structures in java?

939


Is space a char?

880


How do you add an element to a hashset in java?

939


When we serialize an object does the serialization mechanism saves its references too?

970


Difference between a class and an object?

965


How do you know if a value is nan?

1008


what is method reference in java 8?

976