Java OCA OCP Practice Question 1239

Question

What is the output of the following program?

public class Main {
   public static void main(String args[]) {
      boolean[] b = new boolean[2];
      double[] d = new double[2];
      System.out.print(b[0]);
      System.out.println(d[1]);
   }
}
  • A. true0.0
  • B. true0
  • C. false0.0
  • D. false0


C.

Note

The default value of a boolean is false and the default value of a double is 0.0.




PreviousNext

Related