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