Array.length is a property of an array object in Java which returns the number of elements in the array.
The code snippet below illustrates the usage of the Array.length
property in Java:
class HelloWorld {public static void main( String args[] ) {int[] arr = {2, 4, 6, 8, 10};System.out.println("The length of the array is " + arr.length);}}
Free Resources