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

  • SEARCH
  • Home
  • 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 7610429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:24:59+00:00 2026-05-31T01:24:59+00:00

I am still a learner of core java. I want to understand the polymorphism

  • 0

I am still a learner of core java.
I want to understand the polymorphism concepts here.

I have understood the overriding and have a question on overloading.

Why do we call it as method overloading though we are calling different methods(i mean only the arguments are different.) .

I simply feel that it is quite simple as calling different methods which bind during compile time and only difference here is that i have a same method name..

Class A {

    method A(int i){}

    method A(int i, int B){}

}

Please share your inputs.

  • 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-31T01:25:00+00:00Added an answer on May 31, 2026 at 1:25 am

    With method overloading you’re calling “the same method”, only with different parameters and/or different output. This makes it easy for you to write methods with the same core functionality but with different input parameters. Example:

    public int Sum(int a, int b) {
        return a + b;
    }
    
    public double Sum (double a, double b) {
        return a + b;
    }
    

    Otherwise you would have methods like SumInt(…) and SumDouble(…) and so on. You can also have 2 methods with the same return type but different input and still use overloading for ease:

    public int Sum(int a, int b) {
        return Sum(a, b, 0);
    }
    
    public int Sum (int a, int b, int c) {
        return a + b + c;
    }
    

    This way, you only have one place with al the logic and all the other methods just call the one method with all the logic, only with different parameters. And then there’s also constructor overloading. For example you can have an empty constructor in which you set some default values and you can have a constructor where you can set the values yourself:

    //Without overloading you'll have to set the properties after instantiating the class
    public MyClass() {
        this.PropertyOne = "1";
        this.PropertyTwo = 2;
    }
    
    //usage:
    MyClass instance = new MyClass(); 
    //now theproperties are already set to "1" and 2, wheter you like it or not
    //here you change the values
    instance.PropertyOne = "...";
    instance.PropertyTwo = 0;
    
    //With constructor overloading you have this
    public MyClass() {
        this("One", 2);
    }
    
    public MyClass(string propOne, int propTwo) {
        this.PropertyOne = propOne;
        this.PropertyTwo = propTwo;
    }
    
    //usage:
    MyClass instance = new MyClass("MyValue", 1000);
    //if you call MyClass() the default values STILL will be set :)
    

    The second way gives you more possibilities, not? And it makes it a lot more easy to change your code. Hope this helps!

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

Sidebar

Related Questions

i'am a learner so i need still experience and i have many questions, but
Still 'diving in' to Python, and want to make sure I'm not overlooking something.
Still struggling to understand what best practices are with respect to macros. I'm attempting
Still a bit new to Linq. This is driving me nuts. I want to
still new to XML parsing with the iphone so i have a few questions.
Still learning Objective-C / iPhone SDK here. I think I know why this wasn't
Again, learner here. Generally I like to be able to look at the whole
Still on the PHP-OOP training wheels, this question may belong on failblog.org . =)
Still new to python and django, though learning ;-) I have a view that
I am still a learner in installing packages in ubuntu. Actually, I had copied

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.