Q. What is the output of the following code snippet?

Code:
String s1 = “Hello”;
System.out.println(sA)toLowerCase());
  • (A) hello
  • (B) HELLO
  • (C) Hello
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (A) hello
Explanation: The toLowerCase method in Java returns a new string that is the original string with all uppercase letters converted to lowercase. In this case, sA)toLowerCase() returns “hello”.
Explanation by: Kirti
The toLowerCase method in Java returns a new string that is the original string with all uppercase letters converted to lowercase. In this case, sA)toLowerCase() returns “hello”.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
315
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Kirti
Publisher
πŸ“ˆ
80%
Success Rate