answersLogoWhite

0

In a sense, yes, but polymorphism usually refers to an objects ability to have different behaviors than that of it's parent class.

Using an interface among multiple classes ensures that all subclasses have to implement those methods, and thus the objects could be stored in an instance of the superclass to allow for dynamic programming.

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

Is Interfaces in Java a kind of polymorphism?

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.


What is abstraction method in java?

Abstraction in Java or Object oriented programming is a way to segregate implementation from interface and one of the five fundamentals along with Encapsulation, Inheritance, Polymorphism, Class and Object. Abstraction in Java is achieved by using interface and abstract class in Java.


Does java supports polymorphism?

Yes.


What kind of constructs can be declared in a Java interface?

Constants and abstract methods. That's it.


Can you create a constructor for an interface in java?

NO, we cannot create a contructor for an interface in java.


Can you define variables in interface in java?

yes we can define a variable in an interface in java.


What kind of drugs commonly has polymorphism?

Polymorphism is common with barbiturates, steroids, and sulphonamides.


What is intrface in java?

interface is a list of methods which implements that interface


What is polymorphism and its types?

Polymorphism means multiple form of a function, variable or object. In Computer Science, polymorphism is a programming language feature that allows values of different data types to be handles using a common interface. There are three types : Ad-Hoc Polymosphism, Parametric Polymorphism, Subtype/Inclusion Polymorphism. Source: Wikipedia.


What is a tagging interface type?

A tagging interface type in Java is an interface that has not defined methods such as the java.io.Serializable interface.


Does java support oops concept?

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


What java interface must be implemented by all threads?

Runnable interface