KnowledgeBoat Logo
|

Computer Applications

What will be the output of the following Java method?

Character.isLetterOrDigit('\n')
  1. 1
  2. 0
  3. true
  4. false

Java

Java Library Classes

5 Likes

Answer

false

Reason — The method Character.isLetterOrDigit('\n') checks whether the given character is a letter or a digit. The character '\n' represents a newline, which is neither a letter nor a digit, so the method returns false.

Answered By

3 Likes


Related Questions