Does Java guarantee array initialization?
Let's say I use the code char uuid = new char;, would each element be guaranteed to be initialized to 0?
char uuid = new char;
Yes. JLS §10.3 ensures that all elements of an array are set to their initial values, which by JLS §4.12.5 is guaranteed to be 0, false, or null.
Yes, it does guarantee initialization. JLS section 10.3
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
3 years ago