Source: Sun Certified Programmer for Java 6 Study Guide
Pages: 313/314
Authors: Kathy Sierra & Bert Bates
The above code compiles and runs fine,
Im simply asking for a brief explanation
on how the if statement resulted as "true"
bearing in mind that Long and float are
diferrent Types.
Thank you for your help.
OCPJP 6.
In Your Pursuit Towards Certification, NEVER Give Up.
hi Ikpefua,
At line no: 7 in your code. the JVM will automatically do widening conversion of long to float and will compare both the values.
hence the println prints true.
[Vipassana] - It is seeing the reality as it is, And not as you want it to be.!!!
SCJP1.5.
Pravin Shirke wrote:hi Ikpefua,
At line no: 7 in your code. the JVM will automatically do widening conversion of long to float and will compare both the values.
hence the println prints true.
Hi Pravin, thanks a lot for your explanation.
OCPJP 6.
In Your Pursuit Towards Certification, NEVER Give Up.