Hi Vinita,
This one is about primitive types.
The rule is very simple:
Both operands must be integral types (see
JLS, � 15.19).
Therefore:
1.) second operand is a string - false
2.) both operands are integers - ok
3.) second operand is a double, which is not an integral - false
4.) both operands are integral types (first is integer, second is long) - ok
Integral types are:
byteshortcharintegerlongAll other data types are not integral types.
float and long are floating-point typesboolean is a type of its ownall other types are objects Please correct me, if I've got something wrong.
[ May 08, 2002: Message edited by: Mag Hoehme ]