answersLogoWhite

0

Is Interfaces in Java a kind of polymorphism?

Updated: 8/18/2019
User Avatar

Wiki User

12y ago

Best Answer

No. Interfaces in Java are a construct to get polymorphism ( subtype polymorphism ) working in Java, but they are not a "kind" of polymorphism.

In polymorphism happens when two objects respond to the same message ( method call ) in different way ( hence poly -> many, morphism -> way or shape : polymorphism -> many ways). In Java to be able to send the same message to two different objects you have to either inherit the same parent, or implement the same interface.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

i farted and it smells

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Is Interfaces in Java a kind of polymorphism?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Does java supports polymorphism?

Yes.


What kind of inheritance is not allowed in java?

Java does not allow the multiple inheritance of concrete classes, though it does allow a "hybrid" inheritance of one concrete class and multiple interfaces.


What is the minimum number of interfaces that a java class can have?

Zero. By default they do not implement any interfaces.


Why is interfaces used in java?

Interfaces are a way of imposing a type of functionality on all other java classes that are created using it. It is kind of a template that all child classes using this template must follow. All methods that are declared in an interface must be implemented by the child classes and hence the functionality offered by these classes can be controlled using them. Interfaces are a powerful tool that java provides to achieve multiple inheritance.


What is Abstract-Interface in java?

All interfaces are abstract.


What are the alternatives to inheritence in java?

Java does not support multiple inheritance; a subclass cannot have more than one parent. Java compensates for this with interfaces. A class can implement multiple interfaces, but can only extend one class.


What kind of drugs commonly has polymorphism?

Polymorphism is common with barbiturates, steroids, and sulphonamides.


Give the structure of multiple inheritance?

Java does not support multiple inheritance. It is done with the help of interfaces in java. a class can implement n number of interfaces, thus showing multiple inheritance. but a class cannot extend multiple classes in java.


Does java support oops concept?

Yes. Java is an Object Oriented Programming Language and it supports the OOPS concepts like Inheritance, Polymorphism etc


What is compile time polymorphism in java?

Compile Time Polymorphism in Java is when you have the several methods with same name and different parameters and compiler has to decide how to select which method has to run based on the arguments hence the name Compile time polymorphism or method overloading.


Why is Java called an Object Oriented Programming Language?

Actually java is not purely object oriented.because we can use the primitive data types in Java.In java all those things or considered as classes and objects .So we are called java is an object oriented programming language...


Need of interface in java?

Interfaces are used in Java to accomplish most of the goals of Multiple Inheritance. For several reasons, Java only supports Single Inheritance for classes - i.e. a class can have only a single parent. The use of Interfaces is how Java attempts to implement most of the positives of the concept of Multiple Inheritance while avoiding its pitfalls.