This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Originally posted by Burkhard Hassel: ... When you compare two distinct objects with == the result will be always false.
When you compare two primitives, it will be true when the value is the same or false if not...
The way I like to think of this is that == is a comparison of values. For primitives, this is straight forward. For objects, this means a comparison of references, so == will return true only of both operands reference the same object.
Hope that helps.
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org