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 4.7 Assessment: Construct A Scanner
Subgoals for using objects (creating instances).
-
Declare variable of appropriate class datatype.
-
Assign to variable: keyword new, followed by class name, followed by ().
-
Determine whether parameter(s) are appropriate (API)
-
-
Data types of the parameters
Exercises Exercises
1.
Q1: Fill in the blanks for the following code, if the purpose of the code is to create a new Scanner instance called
input
.
________ ________ = ________ ________ (________)
A B C D E
2.
Q2: Fill in the blanks for the following code, if the purpose of the code is to create a new Scanner instance called
input
.
________ ________ = ________ ________ (________)
A B C D E
3.
Q3: Fill in the blanks for the following code, if the purpose of the code is to create a new Scanner instance called
input
.
________ ________ = ________ ________ (________)
A B C D E
4.
Q4: Fill in the blanks for the following code, if the purpose of the code is to create a new Scanner instance called
input
.
________ ________ = ________ ________ (________)
A B C D E
5.
Q5: Fill in the blanks for the following code, if the purpose of the code is to create a new Scanner instance called
input
.
________ ________ = ________ ________ (________)
A B C D E
You have attempted
of
activities on this page.