Reply to post: Re: so wrong

Oracle's Java 15 rides into town, waving the 'we're number one' flag, demands 25th birthday party

Anonymous Coward
Anonymous Coward

Re: so wrong

That's not a quirk - you need to understand the difference between instance (or reference) and logical equality. Each instance of a class is inherently unique, so == should almost only ever be used on primitive types. C++ makes a mess of this by allowing operator overloading so that reference and logical equality often become confused, a quirk - of C++ - that Java's designers were at pains to avoid.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon