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 |
Which variables are stored in stack?
What java ide should I use?
Why do we create threads in java?
Explain about serializable interface in java?
What is the exact difference in between unicast and multicast object? Where we will use?
Why should we use singleton pattern instead of static class?
What is a numeric string?
Describe 2 different ways to concatenate two strings.
Implement two stacks using a single array.
is JVM platform dependent or independent..?
11 Answers IBM, Tech Mahindra,
How do we make a class serialize?
What is data abstraction? Elaborate with example?