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...


Any one can explain how the inerface uses in java. give with
example.



Any one can explain how the inerface uses in java. give with example...

Answer / yogesh sanas

Interface is a contract between class and interface. Interface has some public abstract methods which class needs to be implement.

We can achieve polymorphism using Interface.

e.g.
Interface Interface_Name(){
int add(int x, int y);
}

Class MyClass implements Interface_Name{
public int add(int x, int y){
return x+y;
}
}

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Core Java Interview Questions

What is the difference between variable & constant?

0 Answers  


How we can make copy of a java object?

0 Answers  


Is ++ operator thread-safe in java?

0 Answers  


What does || mean in vectors?

0 Answers  


how to handle http request in struts

2 Answers   Polaris,


what are the diffrences between interface and abstract class?

4 Answers  


Relationship between an event-listener interface and an event-adapter class?

1 Answers  


int a=10,b=20,c=30 a= b+c;b=a+c;c=a+b; System.out.println("The value is"+a+b+c;

17 Answers   Honeywell,


What is difference between static method and static variable?

7 Answers  


Explain enumeration in java?

0 Answers  


Tell us something about different types of casting?

0 Answers  


all are saying java doesn't support multiple inheritance but by default Object class is super class for all the user defined classes and we can extend atmost one class so each class can extend more than one class so java supports multiple inheritance?i am confused with this,pls any one explain me.

4 Answers  


Categories