Computer Applications
What will be the output of the following Java method?
Character.isLetterOrDigit('\n')
- 1
- 0
- true
- 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
What will be the output of the following statement?
String s = "JavaProgramming"; System.out.println(s.substring(4, 11).toUpperCase());- Programm
- PROGRAMM
- PROGRAM
- program
Which of the following access specifiers will make a member accessible only within its own class?
- public
- private
- protected
- default
Which of the following is not a type of token in Java?
1. Method 3. Literal 2. Identifier 4. Keyword - only 1
- 1 and 3
- only 2
- only 4
The statement given below is termed as:
public void Accept(int a)- Method signature
- Method block
- Method prototype
- Constructor