Computer Applications
Consider the following input:
one, two three, four, five
What values will the following code assign to the variables input1 and input2?
String input1 = keyboard.next();
String input2 = keyboard.next();
Input in Java
6 Likes
Answer
input1 ⇒ one,
input2 ⇒ two
Answered By
2 Likes
Related Questions
Distinguish between the following:
next() and hasNext()
Distinguish between the following:
hasNext() and hasNextLine()
Write a code that creates a Scanner object and sets its delimiter to the dollar sign.
Write a line of code that:
i. Creates a Scanner object named scanner to be used for taking keyboard input.
ii. Uses the object scanner to read a word from the keyboard and store it in the String variable named stg.