what is main purpose of interface?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / javachi
The purpose of interface is to create the relationship between the parties involved. parties is nothing but a set of classes relates with each other. this is required when the sub class inherits the property of two or more superclasses(multiple inheritance)
| Is This Answer Correct ? | 7 Yes | 8 No |
Explain the importance of finally block in java?
How to create an instance of a class if the class has private constructor?
what is the difference between HashMap And HashTable?
what is multithreading?
Explain different states of a thread in java?
Is java map thread safe?
Implement 2 stacks with just 1 array. The stack routines must not indicate overflow unless every slot in array is used.
what is mean by synchronization?
3 Answers BOB Technologies, GCPL,
Can constructor be protected in java?
What is meant by data hiding/encapsulation?
What is the main use of generics in java?
why java does not support multiple inheritance
41 Answers Diamond, Euclid, Evergent, KLKJ, Mind Tree, NIIT, SSI Small Scale Industries, Wipro,