102k views
3 votes
Which of the following correctly declares and initializes a Scanner object that will use input from the keyboard as its data source? *

1. Scanner keyboard = new (System.in);
2. Scanner keyboard = new Scanner (keyboard);
3. Scanner = new Scanner(System.in);
4. Scanner keyboard = new Scanner (System.in);

2 Answers

5 votes

Answer:

it 4

Step-by-step explanation:

User Warp
by
4.5k points
4 votes
Option 4 is correct.........
User Kirushik
by
4.1k points