While having a practice on one of the mock exams i got free over the net, I found this question confusing:
What will be the output of the code assuming embedded on a complete program.
Float f1 = new Float("4.4e99f"); Float f2 = new Float("-4.4e99f"); Double d1 = new Double("4.4e99"); System.out.println(f1); System.out.println(f2); System.out.println(d1);
a) Runtime error b) Infinity -Infinity 4.4E99 c) Infinity -Infinity Infinity d) 4.4E99 -4.4E99 4.4E99
I answered D, but the correct answer says it's B. I also tried running this is my editor and it's really B. I looked for the answer explanation in the mock exam but unfortunately I got no explanation why.
Can somebody explain why the answer is B?
"If you fail to plan, you plan to fail."<br /> <br />Chad<br />SCJP 1.4<br />SCWCD 1.4<br />SCBCD 1.3<br />SCDJWS (next)