Hi,
Velu's notes & JQ+ says that line 3 will return false but it returns true when compiling with jdk1.3 . why is it so?
public class vo
{
public static void main(String[] a)
{
float f=1.0f/3.0f;
System.out.println(f);
System.out.println(f*3.0f);
System.out.println((f*3.0f)==1.0f);//3
}
}
i guess this is because jdk1.2 gives that output. But in the actual exam what should be the correct answer to the question ?
Thx in advance
Velu's notes & JQ+ says that line 3 will return false but it returns true when compiling with jdk1.3 . why is it so?
public class vo
{
public static void main(String[] a)
{
float f=1.0f/3.0f;
System.out.println(f);
System.out.println(f*3.0f);
System.out.println((f*3.0f)==1.0f);//3
}
}
i guess this is because jdk1.2 gives that output. But in the actual exam what should be the correct answer to the question ?
Thx in advance