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 static and final keyword in java?

0 Answers  


What is a pointer and does java support pointers?

0 Answers  


What is final class?

0 Answers  


How many bits is a string in java?

0 Answers  


How can a gui component handle its own events?

0 Answers  


What is a nested structure?

0 Answers  


Why can't we make jsp as a controller and action servlet in struts?

8 Answers   TCS, Wipro,


Explain about complier design(phases)

0 Answers   Aditi Placement Service,


While opening the file, what type of exceptions can be caught?

3 Answers  


what is multitherading

3 Answers   Tech Mahindra,


Is array a class in java?

0 Answers  


Is array passed by reference in java?

0 Answers  


Categories