Java tutorial
import java.util.Arrays; public class Main { public static void main(String[] args) { // initializing byte array byte arr[] = new byte[] { 1, 6, 3 }; System.out.println(Arrays.toString(arr)); // using fill for placing 8 // converting int to byte Arrays.fill(arr, (byte) 8); System.out.println(Arrays.toString(arr)); } }