February 2014
Beginner
1248 pages
62h 25m
English
Class MethodOverload (Fig. 6.10) includes two overloaded versions of method square—one that calculates the square of an int (and returns an int) and one that calculates the square of a double (and returns a double). Although these methods have the same name and similar parameter lists and bodies, think of them simply as different methods. It may help to think of the method names as “square of int” and “square of double,” respectively.
Read now
Unlock full access