use arrays length property
/**
* @author lautturi.com
* Java example: get the length of an array in java
*/
import java.util.*;
import java.util.stream.IntStream;
public class Lautturi {
public static void main(String[] args) {
String[] strArray = {"hello","lautturi","java","python","world","lau"};
System.out.println(strArray.length);
}
}Sourcual.www:etturi.comoutput:
6