5 years ago in Java Arrays

What will happen if following code block is compiled/run?
int[] iArray = new int[10];

iArray.length = 15;

System.out.println(iArray.length);

[A] Prints 10
[B] Prints 15
[C] Compilation Error
[D] Run Time Error
Loading...
Next Question

Overall Stats

Attempted 385
Correct 107
Incorrect 109
Viewed 169

Answers

Guest
Guest
Shamsa hafeez
Shamsa hafeez - 2 days ago

Shamsa hafeez from Lahore, Pakistan is saying Prints 10 is correct answer

Rakhi Sharma
Rakhi Sharma - 2 weeks ago

Rakhi Sharma is saying Run Time Error is correct answer

Vaibhav Bisht
Vaibhav Bisht - 1 month ago

Vaibhav Bisht from Dehradun, India is saying Compilation Error is correct answer

Zo Go
Zo Go - 1 month ago

Zo Go from Casablanca, Morocco is saying Prints 15 is correct answer

Fâtïmá Żahřâ Zágñane
Fâtïmá Żahřâ Zágñane - 1 month ago

Fâtïmá Żahřâ Zágñane from Casablanca, Morocco is saying Prints 15 is correct answer

Related Questions