Top

Discussion

How do you instantiate an array in Java?

  • A.int arr[] = new int(3);
  • B.int arr[];
  • C.int arr[] = new int[3];
  • D.int arr() = new int(3);

Answer: C

Note that option b is declaration whereas option c is to instantiate an array.

No comment is present. Be the first to comment.
Loading…

Post your comment