5 years ago in Java Strings

What will happen if you try to compile and run the following code?
public class Q {

public static void main(String argv[]){

int anar[]=new int[5];

System.out.println(anar[0]);

}

}

[A] Error: anar is referenced before it is initialized
[B] null
[C] 0
[D] 5
Loading...
Next Question

Overall Stats

Attempted 297
Correct 88
Incorrect 108
Viewed 101

Answers

Guest
Guest
bruh
bruh - 1 month ago

bruh from Guwahati, India is saying 0 is correct answer

Assaad Amine
Assaad Amine - 1 month ago

Assaad Amine from Casablanca, Morocco is saying 0 is correct answer

Zo Go
Zo Go - 1 month ago

Zo Go from Casablanca, Morocco is saying null is correct answer

Vaibhav Bisht
Vaibhav Bisht - 1 month ago

Vaibhav Bisht from Dehradun, India is saying null is correct answer

Awa Kone
Awa Kone - 1 month ago

Awa Kone from Berrechid, Morocco is saying 0 is correct answer

Related Questions