Java Collection Tutorial - Java Arrays.toString(byte[] a)


Arrays.toString(byte[] a) has the following syntax.

public static String toString(byte[] a)


In the following code shows how to use Arrays.toString(byte[] a) method.

// w w  w .  j a  v a 2 s.c o m

import java.util.Arrays;

public class Main {

   public static void main(String[] args) {

    // initializing byte array
    byte[] b1 = new byte[] { 1, 29, 15 };


The code above generates the following result.