English

Write the output of the following. boolean b2 = Character.isUpperCase('m'); System.out.println(b2);

Advertisements
Advertisements

Question

Write the output of the following.

boolean b2 = Character.isUpperCase('m');

System.out.println(b2);

Very Short Answer
Advertisements

Solution

false

Explanation:

The method Character.isUpperCase('m') checks whether the character inside the parentheses is a capital letter. Because 'm' is a lowercase letter, the method evaluates to false, which is then stored in b2 and printed to the console.

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. (ii) | Page 135
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×