When I initialize an array in Java, for example:
float[] array = new float[1000];
all elements are initialized to 0. This is also the case when I allocate a direct buffer as follows:
FloatBuffer buffer = ByteBuffer.allocateDirect(4*1000).asFloatBuffer();
? I always get only zeros, but maybe it depends on the implementation ...
java initialization buffer
Se norm
source share