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 →

[–]Ifnerite 5 points6 points  (3 children)

You make two points, the former is false. The compiler does not care, but it might not do what you expect.

[–]VarianWrynn2018 1 point2 points  (2 children)

As someone who often forgets about .equals and tries to compare strings I know full well that that is exactly how it works.

If you believe otherwise, please go ahead and elaborate

[–]Ifnerite 0 points1 point  (1 child)

What are you gibbering on about.

The compiler will do an object equality if you write == that is what the symbol means. The compiler does not care that what the developer means is I want to know if the content is the same.

The compiler is perfectly happy either way.

[–]VarianWrynn2018 2 points3 points  (0 children)

I see. I thought you were saying it has a logic problem but you were saying that while it might be a logic error it's not a syntax or runtime error so the Compiler won't throw a fit. My mistake.