1(x)
What will be the output of the following Java method?
Character.isLetterOrDigit('\n')- (a)1
- (b)0
- (c)true
- (d)false
Show SolutionHide Solution↓
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.