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\,}$}}}
\)
Section 3.13 ObjUse-WE6-P1
Subgoals for Calling a Method.
-
Classify method as static
method or instance
method
If static
, use the class name
If instance
, must have or create an instance
Write (instance / class) dot method name and ( )
-
Determine whether parameter(s) are appropriate
Number of parameters passed must match method declaration
Data types of parameters passed must match method declaration (or be assignable)
Determine what the method will return (if anything: data type, void, print, change state of object) and where it will be stored (nowhere, somewhere)
Evaluate right hand side of assignment (if there is one). Value is dependent on method’s purpose
Subsection 3.13.1
For the following questions, fill in the blanks with NO spaces.
For example, use Math.pow(x,y)
rather than Math.pow(x, y)
Exercises Exercises
1.
2.
3.
You have attempted
of
activities on this page.