Create a method name for multiple methods


Discussion:

Q1. 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.

Q2. 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: Create a method name for multiple methods
Reference No:- TGS01934985

Now Priced at $20 (50% Discount)

Recommended (93%)

Rated (4.5/5)