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

what do you understand by synchronization? : Java thread

551


How do you write methodology?

564


What is entry in java?

536


What is final, finally, finalize?

598


How do you declare a variable?

629






If you are given the name of the function at run time how will you invoke the function?

688


What are the methods used to implement for the key object in the hash map?

568


How can we pass argument to a function by reference instead of pass by value?

588


What is meant by null and void?

540


What are java packages? What's the significance of packages?

629


What is a dot notation?

552


Is hashset ordered?

551


What is the difference between serial and throughput garbage collector?

587


What is space character in java?

576


Why do I need to declare the type of a variable in java?

566