What is method overloading?

Based on the parameters used to call the method, the compiler figures out which one to execute at compile time.

While there are some other things happening with overloading in the inheritance context, we will not get into this subject here, but approach it after having already worked with inheritance.

The important thing to note for overloading is that two methods cannot differ only by the return type because when calling one of them, you are calling using the name and the list of parameters and the compiler cannot make the difference between the two.