Q. What will be the output?

Code:
String s = "abc";
s.toUpperCase();
System.out.println(s);
  • (A) ABC
  • (B) abc
  • (C) Compilation Error
  • (D) Runtime Error
πŸ’¬ Discuss
βœ… Correct Answer: (B) abc
Explanation: String is immutable, so original value remains unchanged.
Explanation by: Roshan
String is immutable, so original value remains unchanged.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
26
Total Visits
πŸ“½οΈ
4 mo ago
Published
πŸŽ–οΈ
Roshan
Publisher
πŸ“ˆ
82%
Success Rate