Computer Applications
Write a difference between the functions isUpperCase( ) and toUpperCase( ).
Java Library Classes
ICSE 2018
33 Likes
Answer
| isUpperCase( ) | toUpperCase( ) |
|---|---|
| isUpperCase( ) function checks if a given character is in uppercase or not. | toUpperCase( ) function converts a given character to uppercase. |
| Its return type is boolean. | Its return type is char. |
Answered By
16 Likes
Related Questions
Give the output of the following code:
String P = "20", Q ="19"; int a = Integer.parseInt(P); int b = Integer.valueOf(Q); System.out.println(a+""+b);Predict the output of the following code snippet:
char ch='B', char chr=Character.toLowerCase(ch); int n=(int)chr-10; System.out.println((char)n+"\t"+chr);Assertion (A): Integer class can be used in the program without calling a package.
Reason (R): It belongs to the default package java.lang.
- Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion (A)
- Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of Assertion(A)
- Assertion (A) is true and Reason (R) is false
- Assertion (A) is false and Reason (R) is true