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