B

Bhagwan Das • 4.44K Points
Extraordinary

Q. What will be the output of the following Java statement?
class output {
        public static void main(String args[]) 
        {
            double a, b,c;
            a = 3.0/0;
            b = 0/4.0;
            c=0/0.0;
 
     System.out.println(a);
            System.out.println(b);
            System.out.println(c);
        } 
    }

  • (A) Infinity
  • (B) 0.0
  • (C) NaN
  • (D) all of the mentioned
  • Correct Answer - Option(D)
  • Views: 16
  • Filed under category JAVA

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics