Multiple choice

Which of the following is not a method of the scanner class object in Java?

  1. next()

  2. nextLine()

  3. nextInt()

  4. nextChar()

  5. nextLong()

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

There is no function defined in Scanner class to take character input. So there is no function named nextChar().So this is the correct answer.