What will be the result of compilation of the following code:

double big = 1.0e307 * 2000 / 2000;
System.out.println( big == 1.0e307 );
Explanation
The value of variable big will never become exactly 1.0e307 because of accuracy problems in floating-point operations.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Java quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes