Java Arrays toString Long


Java Arrays toString Long

package com.codingdict;

import java.util.Arrays;

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

      // initializing long array
      long[] l1 = new long[] { 3, 122, 9 };

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

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