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 a treeset in java?

0 Answers  


What is this keyword used for?

0 Answers  


What is java lang object?

0 Answers  


What is the difference between Static and final?

1 Answers  


What are some alternatives to inheritance?

0 Answers  


How do you declare an array that will hold more than 64KB of data?

0 Answers   Aspire, Infogain,


how to run servlet program between two computer through the internet ?

2 Answers   Kiran Prakashan, TCS,


What are the characteristics of Final,Finally and Finalize keywords.

0 Answers   Flextronics,


How do you differentiate abstract class from interface?

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,


Which method is used to find that the object is exited or not?

2 Answers  


What are thread local variables?

0 Answers  


Categories