Computer Applications
Which of the following is the CORRECT java statement to convert the word RESPECT to lowercase?
- "RESPECT".tolowercase( );
- "RESPECT".toLowerCase( );
- toLowerCase("RESPECT");
- String.toLowerCase("RESPECT");
Java String Handling
1 Like
Answer
"RESPECT".toLowerCase( );
Reason — The method to convert a string to lowercase in Java is toLowerCase(), which is called on a string object. It is case-sensitive and must be written exactly as toLowerCase(). Therefore, "RESPECT".toLowerCase() correctly converts the string "RESPECT" to lowercase.
Answered By
2 Likes
Related Questions
Which of the following is a valid method prototype?
- public int perform (int a;int b)
- public perform (int a, int b)
- public int perform (int a, int b)
- public perform int (int a, int b)
Which of the following is the CORRECT statement to invoke the method with the prototype int display(int a, char ch)?
- int m = display('A', 45);
- int m = display( );
- int m = display(A,45);
- int m = display(45,'A');
Which of the following are Wrapper classes?
(i) Boolean
(ii) boolean
(iii) character
(iv) Character- (i) and (iv)
- (ii) and (iv)
- (i) and (iii)
- (ii) and (iii)
Conversion of a wrapper class to its corresponding primitive type is known as :
- unboxing
- autoboxing
- type casting
- parsing