Write a difference between the functions isUpperCase() and toUpperCase().
Advertisements
Questions
Write a difference between the functions isUpperCase() and toUpperCase().
Differentiate between isUpperCase() and toUpperCase().
Distinguish Between
Advertisements
Solution 1
The isuppercase() method is used to check whether the given character is in upper case or not. It returns a Boolean data type.
The toUpperCase() method is used to convert a character or string into upper case. It returns char or String type.
shaalaa.com
Solution 2
| Sr. No. | isUpperCase() | toUpperCase() |
| 1. | The isuppercase() method is used to check whether the given character is in upper case or not. It returns a Boolean data type. | The toUpperCase( ) method is used to convert a character or string into upper case. It returns char or String type. |
| 2. | This function returns true if the parameter is an uppercase letter, and false otherwise. | This function returns the supplied argument in uppercase characters. If a character is already in uppercase, it remains unchanged. If the supplied character is not a letter, it will be returned as is. |
| 3. | Syntax:
|
Syntax:
|
| 4. | Example:
|
Example:
|
shaalaa.com
Is there an error in this question or solution?
Chapter 2: Library Classes - EXERCISES [Page 179]
