Overloading is a way of using the same method name for


1. There are numerous ways to test for equality. == works fine for primitive types, but not for objects such as strings, etc. Why is this so? Discuss why == doesn't work when utilizing Strings but does for integers and doubles.

2. Overloading is a way of using the same method name for multiple methods as long as the number / types of arguments are different. Why is overloading useful? Give an example of how this could be used.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Overloading is a way of using the same method name for
Reference No:- TGS01250322

Now Priced at $20 (50% Discount)

Recommended (90%)

Rated (4.3/5)