Think you’ve mastered Java strings? This simple-looking question tricks many programmers! 🚀
🧠 Quick Breakdown:
1️⃣ Understanding the Code:
java
Copy
Edit
public class Main {
public static void main(String[] args) {
String name = “John”;
System.out.println(name.toLowerCase());
}
}
2️⃣ How toLowerCase() Works:
The method converts all uppercase letters in a string to lowercase.
3️⃣ Final Output:
“John”.toLowerCase() ➡ “john” ✅
Correct Answer: Option C (john)
🚀 Key Takeaways:
✅ toLowerCase() converts text to lowercase but doesn’t change the original string unless reassigned.
✅ Java strings are immutable, meaning the original “John” remains unchanged.
✅ Understand built-in string methods—these appear frequently in coding tests!
📌 Think you got it? Drop your answer in the comments BEFORE checking the solution! 👇
#JavaChallenge #StringMethods #CodingQuiz #JavaBasics #APCSP #Wiingy
——————
About Wiingy
Wiingy is a private tutoring marketplace that connects school students, college students, and young adults with expert-vetted tutors for coding, math, science, computer science, AP, language learning, music and 350+ subjects.
Over 20,000 students have used Wiingy to get matched with top online tutors for conceptual understanding, homework help, project assistance, test prep and language learning.
Download the Wiingy App
Android & iOS: https://wiingy.com/wiingy-app-download/
Book a Free Lesson & get matched with top tutors today
#JavaChallenge #StringMethods #CodingQuiz #JavaBasics #APCSP #Wiingy