What will be the result of execution of following statements?

double x = 2./0;
double y = -1/0.;
System.out.print(x + y);
Explanation
Value of x - POSITIVE_INFINITY
Value of y - NEGATIVE_INFINITY
x+y - NaN
Java
Java Quiz
Start Quiz

or Read more about Java Quiz

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback