The equality operator (==) compares the values of the operands not their type as it makes an implicit promotion to the operands, that's in case of primitive data types operands. The equals() method in the wrapper classes is the one that returns false if the data type of the argument is different from the data type of the object the method is invoked on. Note: In case of using (==) with objects the comparison is made between the value of the references not the meaningful value of the object. HTH [ December 10, 2002: Message edited by: Alfred Kemety ]
Before performing the equality test (==) both operands are promoted. The left hand side will be a double since the variable a is a double primitive. The right hand side will be promoted to a double before the equality comparison. The left hand side is equal to 388.0 (a double not a float) The right hand side is equal to 388 (4 * 97) and is promoted to a double, that is 388.09, and then compared. The result is obviously true.