<div dir="ltr">Hi, folks,<br><br>I'm glad that "JEP 463: Implicitly Declared Classes and Instance main Methods" can help beginners start writing basic programs with limited skills and understanding. However, recently I came across this post [<a href="https://twitter.com/relizarov/status/1767978534314627304">https://twitter.com/relizarov/status/1767978534314627304</a>] and I recall having asked similar questions here before [<a href="https://mail.openjdk.org/pipermail/amber-dev/2023-October/008334.html">https://mail.openjdk.org/pipermail/amber-dev/2023-October/008334.html</a>]. But today, I am explaining Java's design to a beginner from the perspective of a semi-experienced developer.<br><br>As we transitioned our tech stack from C# to the Java ecosystem, we also welcomed a new colleague who was previously accustomed to PHP. During my guidance on Java, we had the following conversation:<br><br>New colleague: Why do we use `equals()` for string comparison instead of `==` or `===`?<br>Me: Because `String` is an object.<br>New colleague: Then why can we concatenate strings with the `+` operator?<br>Me: The `+` operator is actually shorthand for `StringBuilder.append()`. From an OOP perspective, you can also use `string1.concat(string2)`.<br>New colleague: Why isn't the `+` operator used for `BigDecimal` addition here?<br>Me: Because it's also an object...<br>New colleague: Looking back, if strings are objects, shouldn't it be `String string1 = new String()` and then `string1.setValue(new char[] { 's', 't', 'r', 'i', 'n', 'g' })`?<br>Me: That would be too cumbersome... By the way, how did you compare strings in PHP?<br>New colleague: `===`, `strcmp()` is also an option, but less common.<br>And after many more questions...<br>Me: Don't ask, just write, let it become a part of you!<br><br>Do you have any better explanations for Java's design for beginners?<div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><br>/* GET BETTER EVERY DAY */<br><br><br></div></div></div></div>