1/**
2* An Example to get the Array Length is Java
3*/
4public class ArrayLengthJava {
5public static void main(String[] args) {
6String[] myArray = { "I", "Love", "Music" };
7int arrayLength = myArray.length; //array length attribute
8System.out.println("The length of the array is: " + arrayLength);
9}
10}
11
1Int[] array = {1,2,3};
2int lengthOfArray = array.length; /** Finding the length of the array and storing it */
3System.out.println(String.valueOf(lengthOfArray)); /** Should print out 3, String.value Of() is optional as printLn does this automatically. */
1let coolCars = ['ford', 'chevy'];
2//to find length, use the array's built in method
3let length = coolCars.length;
4//length == 2.