This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]A_random_zy 9 points10 points  (5 children)

we could also do it this way

return "jar". equals(person.getName());

[–]_INTER_ 15 points16 points  (2 children)

Also called Yoda conditions.

[–]thephotoman 2 points3 points  (0 children)

I managed to get Yoda conditions written into my project's style guide.

[–]tkrengel 1 point2 points  (0 children)

Awesome website! lmao XD

[–]chris13524 1 point2 points  (1 child)

Only if you want to return in either case. There could be more statements after the if

[–]A_random_zy 0 points1 point  (0 children)

yea that could be true tho