Java Arrays toString Byte


Java Arrays toString Byte

package com.codingdict;

import java.util.Arrays;

public class ArrayDemo {
   public static void main(String[] args) {

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

      // let us print all the elements available in list
      System.out.println("The array is:");
      for (byte number : b1) {
         System.out.println("Number = " + number);
      }

      System.out.println("The string representation of array is:");
      System.out.println(Arrays.toString(b1));    
   }
}