Scanner Flashcards

(3 cards)

1
Q

What do you import to use Scanner?

A

import java.util.Scanner;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you confirm using Scanner?

A

Scanner nameOfFunction = new Scanner(System.in);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What must you type if you want an int?
What about a double or string?
What about a boolean?

A

String nameOfFunction = input.nextLine()
int nameOfFunction = input.nextInt()
double nameOfFunction = input.nextDouble()
boolean nameOfFunction = input.nextBoolean()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly