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.

Answers were Sorted based on User's Feedback



Marker interface means , interface which has no methods.Then what is the necessity of its usage.I r..

Answer / 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

Marker interface means , interface which has no methods.Then what is the necessity of its usage.I r..

Answer / ras

To store the state of object

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

How do you achieve polymorphism in java?

0 Answers  


Can we add two byte variables and assign the result to a byte variable ? b=b1+b2 where b,b1,b2 are byte types

4 Answers   TCS,


Explain the difference between jdk, jre, and jvm?

0 Answers  


How to display arraylist values in java?

0 Answers  


Is static a keyword in java?

0 Answers  


What are triggers in DB? Explain their types. How do they work?

0 Answers   Amdocs,


how to print the below in java?thanks in advance.... * * * * * * * *

3 Answers  


What is main method?

0 Answers  


What is composition in java?

0 Answers  


Explain the difference between static and dynamic binding in java?

0 Answers  


Write a java program that prints all the values given at command-line.

0 Answers  


What restrictions are placed on method overloading in java programming?

0 Answers  


Categories