why this code
"name".equals(person.getName());
is better than
person.getName().equals("name");
I prefer the Yoda Expression "name".equals(person.getName()); since it means you don't need to check if person.getName() is null. That saves a bit of typing and is arguably clearer once you get used to it.
Although in your case, you'll still need to check if person is not null.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With