How to initailize byte array of 100 bytes in java with all 0's -


how initialize byte array of 100 bytes in java 0's. want create 100 byte array , initialize 0's

a new byte array automatically initialized zeroes. don't have anything.

the more general approach initializing other values, use arrays class.

import java.util.arrays;  byte[] bytes = new byte[100]; arrays.fill( bytes, (byte) 1 ); 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -