why do we use interface in java?

Answer Posted / navinice

We use Interfaces in java because JAVA Doesn't support
multiple inheritance. Thats why no any class can extend more
than one class in JAVA.. But through Interfaces we can
implement more than one interfaces and use there methods in
base class.

Is This Answer Correct ?    6 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between keyword and identifier.

791


How does list work in java?

711


What is the access scope of a protected method?

764


What is a flag and how does it work?

758


What is maximum size of arraylist in java?

723


What if the main() method is declared as private? What happens when the static modifier is removed from the signature of the main() method?

953


What is difference between overloading and overriding in java?

758


What do you mean by global variable?

728


Which are the two subclasses under exception class?

768


What is the this keyword?

793


Where are the local variables stored?

790


What is %02d?

797


What is variable and constant explain with example?

778


What is the purpose of methodology?

855


What are the difference between composition and inheritance in java?

756