Advertisements
Advertisements
प्रश्न
Consider the array given below:
char ch[]={'A','E','I','O','U'};
Write the output of the following statements:
System.out.println(ch[0]*2);;पर्याय
65
130
'A'
0
Advertisements
उत्तर
130
Explanation:
- In Java, characters are represented using their ASCII values.
- The ASCII value of 'A' is 65. When ch[0]*2 is executed, it multiplies the ASCII value of 'A' (which is 65) by 2, resulting in 130.
APPEARS IN
संबंधित प्रश्न
Write the return data type of the following function:
endsWith( )
Give the output of the following string methods.
"MISSISSIPPI".indexOf('S') + "MISSISSIPPI".lastIndexOf('I')
Define a class to accept a string, convert it into lowercase and check whether the string is a palindrome or not.
A palindrome is a word that reads the same backward as forward.
Example:
madam, racecar etc.
The String class method to join two strings is ______.
The output of the function "COMPOSITION". substring(3, 6):
Give the output of the following String class method:
"devote". compareTo("DEVOTE")int x = 98; char ch = (char)x; what is the value in ch?
The output of the statement "CONCENTRATION" indexOf('T') is ______.
The output of the statement "talent". compareTo("genius") is ______.
The following code to compare two strings is compiled, the following syntax error was displayed - incompatible types - int cannot be converted to boolean.
Identify the statement which has the error and write the correct statement. Give the output of the program segment.
void calculate()
{
String a="KING",b="KINGDOM";
boolean x=a.compareTo(b);
system.out.println(x);
}