Multiple choice

Which of the following is not the 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(). Hence, this is the correct answer.