Input Statements Using the Command Prompt

0.0(0)
studied byStudied by 1 person
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/10

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

11 Terms

1
New cards

import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.IOException;

Import statements needed to accept inputs.

2
New cards

InputStreamReader

Enables the user to enter values in the command prompt

3
New cards

BufferedReader

Stores the value entered by the user to the buffer (temporary storage).

4
New cards

readLine

Reads/accepts values entered by the user. It assigns the value read to a variable declared as type String.

5
New cards

Integer.parseInt()

Imported from java.lang. Converts String to integer values.

6
New cards

Scanner

From the java.util package. A standard input device that puts data into variables.

7
New cards

object.nextInt()

Scanner, the next input token is an integer.

8
New cards

object.nextDouble()

Scanner, the next input token is a floating-point number.

9
New cards

object.next()

Scanner, next input is a String.

10
New cards

object.nextLine()

Scanner, next input token in a String until the end of the line.

11
New cards

object.next().charAt(0)

Scanner, next input token is a single printable character.