English

Write the output of the following. boolean b3 = Character.isWhitespace('\n'); System.out.println(b3);

Advertisements
Advertisements

Question

Write the output of the following.

boolean b3 = Character.isWhitespace('\n');

System.out.println(b3);

Very Short Answer
Advertisements

Solution

true

Explanation:

The method Character.isWhitespace('\n') checks whether the given character counts as blank space. Because '\n' represents the newline character (which creates a blank line space when you press Enter), Java classifies it as a whitespace character, evaluating the expression to true.

shaalaa.com
  Is there an error in this question or solution?
Chapter 5: Library Classes - Exercises [Page 135]

APPEARS IN

Rupa Pandit Computer Applications [English] Class 10 ICSE
Chapter 5 Library Classes
Exercises | Q 5. (iii) | Page 135
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×