Skip to main content\(
\newcommand{\lt}{<}
\newcommand{\gt}{>}
\newcommand{\amp}{&}
\definecolor{fillinmathshade}{gray}{0.9}
\newcommand{\fillinmath}[1]{\mathchoice{\colorbox{fillinmathshade}{$\displaystyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\textstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptscriptstyle\phantom{\,#1\,}$}}}
\)
Chapter 3 Methods: Communicating with Objects
After studying this chapter, you will
Objectives
Understand the role that methods play in an object-oriented program.
Know how to use parameters and arguments to pass data to an object.
Understand how constructor methods are used to instantiate objects.
Know the difference between passing a value and passing a reference to an object.
Be able to design your own methods.
Know how to use the if-else
and while
control structures.