Lesson 5 of 10
Arrays
Arrays in Java have a fixed size and store elements of the same type. Declare them with square brackets. Use the length property to get the size.
JAVA
int[] numbers = {10, 20, 30, 40};
String[] names = new String[3];
names[0] = "Ali";
names[1] = "Sara";
System.out.println(numbers[0]); // 10
System.out.println(names.length); // 3