Java User Input

Java User Input

Assessment

Flashcard

Computers

11th Grade

Hard

Created by

Dina Sharawy

Used 1+ times

FREE Resource

Student preview

quiz-placeholder

18 questions

Show all answers

1.

FLASHCARD QUESTION

Front

What is the purpose of the Scanner class in Java?

Back

The Scanner class is used to take input from the user.

2.

FLASHCARD QUESTION

Front

How do you import the Scanner class in Java?

Back

You import the Scanner class using: import java.util.Scanner;

3.

FLASHCARD QUESTION

Front

How do you create a Scanner object to read input from the keyboard?

Back

You create a Scanner object with: Scanner input = new Scanner(System.in);

4.

FLASHCARD QUESTION

Front

What method is used to read an integer value using Scanner?

Back

The method nextInt() is used to read an integer value.

5.

FLASHCARD QUESTION

Front

What method is used to read a double value using Scanner?

Back

The method nextDouble() is used to read a double value.

6.

FLASHCARD QUESTION

Front

How do you read a line of text using Scanner?

Back

You use the method nextLine() to read a line of text.

7.

FLASHCARD QUESTION

Front

What method is used to read a single word using Scanner?

Back

The method next() is used to read a single word.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?