What is the Polymorphism in Java?

I really want to know the polymorphism in java . I'm learning java now that's why I'm asking this question.

Replies (1)
  • Compile-Time: Uses Overloading (same name, different parameters). Resolved by the compiler.

  • Runtime: Uses Overriding (subclass replaces parent method). Resolved by the JVM while the program is running.

  • Core Benefit: It allows you to write generic, reusable code that can handle various related object types without needing to know their specific implementation details in advance.

Leave a Reply

Your are not logged in . Please login to post replies

Click here to Login / Register