Advertisements
Advertisements
प्रश्न
Write a difference between the functions isUpperCase() and toUpperCase().
Differentiate between isUpperCase() and toUpperCase().
Advertisements
उत्तर १
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.
उत्तर २
| 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:
|
APPEARS IN
संबंधित प्रश्न
Write the memory capacity (storage size) of short and float data type in bytes.
State the number of bytes occupied by char and int data types.
State one difference between the floating point literals float and double.
What is the data type returned by the library function?
compareTo()
What will be the output when the following code segment is executed?
System.out.println(“The king said\”Begin at the beginning!\“to me.”);
Design a class to overload a function area( ) as follows:
(i) double area (double a, double b, double c) with three double arguments, returns the area of a scalene triangle using the formula:
area = `sqrt ("s" ("s" - "a")("s" - "b")("s" - "c")) "2ab"`
where `"s" = ("a" + "b" + "c")/2`
(ii) double area (int a, int b, int height) with three integer arguments, returns the area of a trapezium using the formula:
area = `1/2` height (a+b)
(iii) double area (double diagonal 1, double diagonal 2) with two double arguments, returns the area of a rhombus using the formula :
area = `1/2` (diagonal 1 × diagonal 2)
Give the output of the following Character class method:
Character.toUpperCase('a')Give the output of the following Character class method:
Character.isLetterOrDigit('W')What is the method to check whether a character is a letter or digit?
The method to convert a lowercase character to uppercase is ______.
