-
What is the output of this program?
public class isinfinite_Example
{
public static void main(String args[])
{
Double num = new Double(1 / 0.);
boolean p = num.isInfinite();
System.out.print(p);
}
}
-
- true true
- false false
- false
- true
- None of these
Correct Option: D
isInfinite() method returns true is the value being tested is infinitely large or small in magnitude. 1/0. is infinitely large in magnitude hence true is stored in p.