1/10
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.IOException;
Import statements needed to accept inputs.
InputStreamReader
Enables the user to enter values in the command prompt
BufferedReader
Stores the value entered by the user to the buffer (temporary storage).
readLine
Reads/accepts values entered by the user. It assigns the value read to a variable declared as type String.
Integer.parseInt()
Imported from java.lang. Converts String to integer values.
Scanner
From the java.util package. A standard input device that puts data into variables.
object.nextInt()
Scanner, the next input token is an integer.
object.nextDouble()
Scanner, the next input token is a floating-point number.
object.next()
Scanner, next input is a String.
object.nextLine()
Scanner, next input token in a String until the end of the line.
object.next().charAt(0)
Scanner, next input token is a single printable character.