What is the result of compiling and running the following code?

public class Main {
    public static void main(String s[]) {
        int anar[] = new int[5];
        System.out.println(anar[0]);
    }
}
Explanation
Arrays of primitive number types are initialized with 0.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Java quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes