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
संबंधित प्रश्न
Give the output of the following code:
String P = “20”, Q = “19”,
int a = Integer .parselnt(P);
int b = Integer. valueOf(Q);
System.out.println(a+””+b);
State the data type and value of res after the following is executed:
char ch = ‘t’;
res=Character. toUpperCase(ch);
int res = ‘A’;
What is the value of res?
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.”);
Give the output of the following code.
String A = "26.0", B= "74.0";
double C = Double.parseDouble(A);
double D = Double.parseDouble(B);
System.out.println((C+D));
Give the output of the following Character class method:
Character.toUpperCase('a')Give the output of the following Character class method:
Character.isLetterOrDigit('W')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);
