Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (6.5k points)
In how many ways can polymorphism be implemented?

1 Answer

0 votes
by (11.3k points)

There are two types of polymorphism in JAVA. The first is compile-time polymorphism in which all calls and overrides are resolved at compile time itself. The second one is runtime polymorphism in which all of these things are resolved at runtime upon execution of the byte code. Runtime polymorphism is achieved via inheritance and interfaces. If you're looking to learn java from a practical perspective, you'll find polymorphism in the following cases:

  • Method Overloading
  • Method Overloading with Inheritance (Parent Class and Child Class)
  • Method Overriding after implementing a JAVA interface.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...