Java Reference
In-Depth Information
CHAPTER
5
M
ETHODS
Objectives
To define methods with formal parameters (§5.2).
■
To invoke methods with actual parameters (i.e., arguments) (§5.2).
■
To define methods with a return value (§5.3).
■
To define methods without a return value (§5.4).
■
To pass arguments by value (§5.5).
■
To develop reusable code that is modular, easy to read, easy to debug, and
easy to maintain (§5.6).
■
To write a method that converts decimals to hexadecimals (§5.7).
■
To use method overloading and understand ambiguous overloading (§5.8).
■
To determine the scope of variables (§5.9).
■
To solve mathematics problems using the methods in the
Math
class
(§§5.10-5.11).
■
To apply the concept of method abstraction in software development (§5.12).
■
To design and implement methods using stepwise refinement (§5.12).
■