0 votes
in JAVA by
How to find the length of an array in java?

1 Answer

0 votes
by
How to find the length of an array in java?

class ArrayLengthFinder {

   public static void main(String[] arr) {

      // declare an array

      int[] array = new int[10];

      array[0] = 12;

      array[1] = -4;

      array[2] = 1;

      // get the length of array

      int length = array.length;

      System.out.println(""Length of array is: "" + length);

   }

}
...