1 String[] names = {
2 "Liam",
3 "Olivia",
4 "Noah",
5 "Emma",
6 "Oliver",
7 "Ava",
8 "William",
9 "Sophia",
10 "Elijah",
11 "Isabella",
12 "James",
13 "Charlotte",
14 "Benjamin",
15 "Amelia",
16 "Lucas",
17 "Mia",
18 "Mason",
19 "Harper",
20 "Ethan",
21 "Evelyn"
22 };
1For example: int[ ] num = new int[6];
2public class AccessingArrayElements
3{
4 public static void main(String[] args)
5 {
6 int[] arrNum = {25, 23, 15, 20, 24};
7 for(int a = 0; a < arrNum.length; a++)
8 {
9 System.out.println(arrNum[a]);
10 }
11 }
12}