what is main purpose of interface?

Answers were Sorted based on User's Feedback



what is main purpose of interface?..

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

what is main purpose of interface?..

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

Post New Answer

More Core Java Interview Questions

Which variables are stored in stack?

0 Answers  


What java ide should I use?

0 Answers  


Why do we create threads in java?

0 Answers  


Explain about serializable interface in java?

0 Answers  


What is the exact difference in between unicast and multicast object? Where we will use?

0 Answers  






Why should we use singleton pattern instead of static class?

0 Answers  


What is a numeric string?

0 Answers  


Describe 2 different ways to concatenate two strings.

0 Answers   TCS,


Implement two stacks using a single array.

0 Answers   Global Logic,


is JVM platform dependent or independent..?

11 Answers   IBM, Tech Mahindra,


How do we make a class serialize?

3 Answers   Syntel,


What is data abstraction? Elaborate with example?

4 Answers   BMC, TCS,


Categories