Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+6 votes
asked in CSC211_Winter2018 by (1 point)

2 Answers

+3 votes

Method overloading happens when two methods of the SAME class have the same name, but different signatures. One example is the substring method of the String class. The string class has two methods named substring, one with two int parameters and one with one int parameter.

answered by (1 point)
+2 votes

Overloading a method refers to creating multiple methods with the same name in the same class that have different return types. Take the Random class for example: rand.nextInt() calls on a method that returns a value of type int, and rand.nextDouble calls on a method with the same name that returns a value of type double. They call on methods with the same name inside the Random class that have different return types.

answered by (1 point)
edited by
...