You cannot compare a primitive with an object, youmust turn the object into a primative.if ( p3 == 1 )turns intoif ( p3.intValue() == 1 )