K

Kirti • 10.45K Points
Tutor II

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
  • Correct Answer - Option(A)
  • Views: 197
  • Filed under category JAVA

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”.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics