what is main purpose of interface?

Answer Posted / saikatk

There is no multiple inheritance in java,we can't extends
more than one class at a time,so interface is a way to
implement multiple inheritance in java, and from design
point view when we have some class specific behaviours we
can put interface as a base of the classes.

Is This Answer Correct ?    44 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are methods in java?

542


What are encapsulation, inheritance and polymorphism?

533


What are the characteristics of java?

529


What is the destroy method?

592


Can a constructor be private and how are this() and super() method used with constructor?

531






What are structs in java?

582


What is the final keyword in java?

561


How do you do absolute value in java?

529


What data type is string java?

543


Explain the available thread states in a high-level?

535


Why wait(),notify(),notifyAll() methods defined in Object class althought we are using in only threads.

2378


Can a class be protected in java?

510


what is session in java?

758


What is string data?

561


How many JVMs can run on a single machine and what is the Just-In-Time(JIT) compiler?

582