Reading integer input from the keyboard
Reading integer input from the keyboard
The
steps
to
read in
an
integer value
from the
keyboard
is the
same
as those described for
floating point values
The
only
differences
are:
You need to
define
an
int
typed variable
to
receive
the input (because we are reading in an
integer
number
)
You need to use the
nextInt()
method
which will
read in
an
integer value
Summary
of the
steps
to
read in
an
integer value
:
We will look at an example a little bit later.