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 encapsulation in java? Explain

0 Answers  


Can anonymous class have constructor?

0 Answers  


Can a class have 2 constructors?

0 Answers  


Explain working of call by reference function invoking.

0 Answers   Amdocs,


What variables are stored in stack?

0 Answers  


What are keywords give examples?

0 Answers  


Can a boolean be null java?

0 Answers  


What is internal variable?

0 Answers  


What are the major advantages of internal iteration over external iteration?

0 Answers  


Is zero a positive integer?

0 Answers  


What will be the output of round(3.7) and ceil(3.7)?

0 Answers  


Is a boolean variable?

0 Answers  


Categories