Length of string in Array in Java

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

                String[] strArray = new String[]{"Java", "String", "Array", "Length"};
                int length = strArray.length;
               
                System.out.println("String array length is: " + length);
               
                //print elements of an array
                for(int i=0; i < length; i++){
                        System.out.println(strArray[i]);
                }
        }
}