Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
What line of code is needed to import the Scanner class?
Remember the keyword to bring in a class.
How do you create a Scanner object?
Think about the declaration syntax in Java.
What must be included at the top of your Java program to use the Scanner class?
Look for the line that brings in external classes.
Which method would be used to read an integer?
Think about what 'nextInt' might suggest in terms of functionality.
Create a Java program that asks the user for their full name, age, and favorite color, and then prints a statement that includes all three.
Consider the order of inputs and how to handle the newline character after using nextInt.
Discuss how you might improve user experience when taking input in a program with Scanner. Provide code snippets if necessary.
Think about how you can guide the user through input.
6 more questions in this section. Enroll free to practise them all.
Enroll free