/**
* An Example to get the Array Length is Java
*/publicclass ArrayLengthJava {
public static void main(String[] args) {
String[] myArray = { "I", "Love", "Music" };
int arrayLength = myArray.length; //array length attributeSystem.out.println("The length of the array is: " + arrayLength);
}
}
The size of an array cannot be changed after instantiation
If you need to change the size, create a newarrayand copy the contentsoruse an ArrayList which does require a setsize