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
What are methods in java?
What are encapsulation, inheritance and polymorphism?
What are the characteristics of java?
What is the destroy method?
Can a constructor be private and how are this() and super() method used with constructor?
What are structs in java?
What is the final keyword in java?
How do you do absolute value in java?
What data type is string java?
Explain the available thread states in a high-level?
Why wait(),notify(),notifyAll() methods defined in Object class althought we are using in only threads.
Can a class be protected in java?
what is session in java?
What is string data?
How many JVMs can run on a single machine and what is the Just-In-Time(JIT) compiler?