Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3944854
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:57:00+00:00 2026-05-20T00:57:00+00:00

I know that this question has been done to death at StackOverflow and that

  • 0

I know that this question has been done to death at StackOverflow and that there are numerous questions posted on this already. I’ve probably read every one of them and yet, there’s this niggling doubt: I think I understand Overloading pretty well, and Overriding. What gets me is Polymorphism.

For example, the accepted answer to this question explains this with shape.Draw(). I’m confused as to how this is different from Overriding (other times I’m confused with how it is different from Overloading).

Also – does Polymorphism inherently mean deriving from an abstract class? (I think almost all the answers I’ve read on the topic uses an abstract animal class and makes a cat and a dog meow/bark 🙂

To sum up, my questions are:

  1. What is Polymorphism w.r.t. Overloading and Overriding?

  2. Could somebody please explain Polymorphism without an abstract class – thanks!

  3. Overloading/Overriding are not subtypes of Polymorphism, are they?

Edited to add a 3rd question and modify the 2nd question.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T00:57:01+00:00Added an answer on May 20, 2026 at 12:57 am

    To answer your questions:

    1. It’s the ability to select more specialized methods in runtime depending on the object being used to call it.
    2. Of course. Polymorphism could occur with no abstract classes involved.
    3. No, overloading/overriding are not types of polymorphism.

    Here’s an example with polymorphism happening with no abstract classes involved.

    // non abstract
    class A
    {
        public void a()
        {
            System.out.println("Hello from A");
        }
    }
    
    class B
       extends A
    {
        @Override
        public void a()
        {
            System.out.println("Hello from B");
        }
    }
    
    class C
    {
        public static void SomeStatic(A a)
        {
             // HERE IS WHERE POLYMORPHISM OCCUR
             a.a();
        }
    }
    

    Polymorphism in class C occurs because SomeStatic method could be call with a Reference to A object or a Reference to B object. If it’s called with a reference to A, A‘s a method will be called. If it’s called with a reference to B, B‘s a method will be called. This ability of changing, on runtime, the actual method being called is called Polymorphism.

    Overloading barely has anything to do with Polymorphism. In fact, you can hace overloading with no inheritance involved if you want. You could even have overloading with no object orientation involved. Overloading is just letting two function to exist with the same name but with different parameters.

    Overriding on the other hand, is just re-defining a method on a specialized (inherited) class. Overriding a method is necessary for polymorphism to happen. Otherwise, the would be no DUAL POSSIBILITIES on runtime (take a close look at the example).

    Class C is the key to understand it all:

    class Main
    {
        public static void main(String[] args)
        {
            A a = new A();
            B b = new B();
            C.SomeStatic(a); // will call A's a
            C.SomeStatic(b); // will call B's a
            // AND THIS IS POLYMORPHISM
            // C will decide WHICH METHOD TO CALL 
            // only at runtime
        }
    }
    

    Poly: comes from greek. Means many.
    Morph: comes from greek. Means form.

    So in Polymorphism there are “many” (poly) “forms” (morph) of calling a method. Which one will be called, depends on the object being used to call the method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this question has been done but I have a slightly different twist
I know this question has been posted before... but I haven't found any answer
I know this question has been asked before but I still haven't seen a
I know this question has been asked many times, but my problem is a
OK, I know that this has been asked previously, so please forgive me for
I know this question has been asked and answered in several ways, but none
I know that this is a simple question for PHP guys but I don't
I don't know if this is too specific a question, if that is possible,
I know that this is somewhat subjective, but I wonder if there is a
What tools are out there that compete with this product? CodeKana I know ReSharper

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.