how to get the size of array in java

how to get the size of array in java

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);

	}
}
Sourc‮‬e:www.lautturi.com

output:

6
Created Time:2017-09-10 11:28:05  Author:lautturi