Use == operator to compare two primitives,or to see if two references refer to the same object.
Remember ,the == operator cares only about the
pattern of bits in the variable.The rules are the same whether the variable is a reference or primitive.
Example : (1) Comparing two primitives
int a = 9;
byte b = 9;
if( a == b) { // true }
(2) Comparing two references
Zoom a = new Zoom();
Zoom b = new Zoom();
Zoom c = a;
if(a == b) { // false }
if(a == c) { // true }
if(b == c) { // false }
regards
SADASIVAKUMAR UTTI
SCJP1.4