adplus-dvertising
frame-decoration

Question

What is the output of below snippet?
Object[] names = new String[3];
names[0] = new Integer(0);

a.

ArrayIndexOutOfBoundsException

b.

ArrayStoreException

c.

Compilation Error

d.

Code runs successfully

Posted under Java Programming

Answer: (b).ArrayStoreException

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of below snippet?