Skip to content
Related Articles

Related Articles

Java | Arrays | Question 4

View Discussion
Improve Article
Save Article
Like Article
  • Difficulty Level : Basic
  • Last Updated : 28 Jun, 2021

class Test {
   public static void main(String args[]) {
     int arr[] = new int[2];  




garbage value
garbage value

(C) Compiler Error
(D) Exception

Answer: (A)

Explanation: Java arrays are first class objects and all members of objects are initialized with default values like o, null.

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!