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


What is the use of an interface?

Answers were Sorted based on User's Feedback



What is the use of an interface?..

Answer / harathi

We can define a set of methods in an interface and
implement it in different ways in different classes

Is This Answer Correct ?    4 Yes 1 No

What is the use of an interface?..

Answer / muthusenthil

Interface is mearly a specification, its a design flexible
it can be used to model multiple inheritance normally java
wont supports.

Is This Answer Correct ?    3 Yes 1 No

What is the use of an interface?..

Answer / ashokmail

By using interface you can do multiple inheritance in java.

Example :
interface student{
public void add();
}

public class clloge implements student{
public clloge(){
}
public void add(){
// Some codes
}
}

public class croom implements student{
public croom(){
}
public void add(){
// Some codes
}
}

Using Interface..
public void uinter {
private student[3] stu ;

public uinter(){
stu[0] = new croom();
stu[1] = new clloge()
stu[2] = new croom();
for(int i=0;i<3;i++)
stu[i].add();
}
}

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More Core Java Interview Questions

What is printwriter in java?

0 Answers  


What is a Java switch statement, and how can it be used?

2 Answers  


what is language and it responsibilities

1 Answers  


what is the difference between equals method and ==

17 Answers   IBM, Professional Access, TCS,


what is difference betwwen hashmap and hashtable ?

7 Answers   Fidelity,


What is the significance of java packages?

0 Answers  


Does java vector allow null?

0 Answers  


Why do we declare a class static?

0 Answers  


what is a static block?

4 Answers  


when asub class inherits a super class and overrides a public method of super class in sub class(public method in super class). why these methods needs to be public in sub class. (otherwise compile time error).

3 Answers  


What is the epoch date?

0 Answers  


What are peerless components?

0 Answers  


Categories