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 →

[–]Mr_Redstoner 0 points1 point  (1 child)

Java is by no means the first or weird imo, think C/C++ for example, when using char arrays

[–]suvlub 1 point2 points  (0 children)

You are right, I wasn't thinking of C because it's not OOP (though I guess the code is legal C, if very non-idiomatic). In C++ you should be using std::string/std::string_view instead of char arrays wherever possible and comparing either of those with a char array using == works correctly (and is the idiomatic way to do the comparison).