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 |
What is the public method modifier?
What is AppletStub?
What is boolean used for?
How can two threads be made to communicate with each other?
Explain serialization and deserialization in java?
When a thread is executing synchronized methods , then is it possible to execute other synchronized methods simultaneously by other threads?
Difference between overloading and Overriding. <Giving a confusing example to test the concept.> (also asked in PA Consultancy Group,iflex,Value chain,IBM,CTS,Accenture, Tarang>
12 Answers Accenture, CTS, Extensio, IBM, iFlex, PA Consulting, Symphony, Tarang,
How do I enable java in safari?
why there are multiple catches for a try block.don't tell me that there can be multiple exception of a code segment that's why.tell me the real fact behind this.
What is boolean flag in java?
Why do we need autoboxing in java?
What is a Java switch statement, and how can it be used?