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.
Java
Java Quiz
Start Quiz

or Read more about Java Quiz

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback