If I use a statement in my code like
int[] a = new int[42];
Will it initialize the array to anything in particular? (e.g. 0) I seem to remember this is documented somewhere but I am not sure what to search for.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
At 15.10 Array Creation Expressions the JLS says
and at 4.12.5 Initial Values of Variables it says: