Softwareentwicklung
[EN] Strings in Java: Why …
Hello everyone,
Today we’re diving into a Java topic that causes headaches for many developers, especially at the beginning: The
Comparing strings using the == operator. You’ve probably heard that strings are always with you
.equals() should compare. But then why do the following tests …
[EN] Why `.equals()` and …
A few months ago I had a short discussion in a merge request with an experienced developer who asked me
that’s why
asked to undo my refactoring because == was easier to read.
![[EN] Strings in Java: Why `==` sometimes works and sometimes doesn't](/images/BlogHeaderStringPool.jpeg)
![[EN] Why `.equals()` and not `==` for object comparison in Java?](/images/BlogHeaderEquals.jpeg)