Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Main {
- public static void main(String[] args) {
- // create an array
- int[] age = {12, 4, 5, 2, 5};
- // access each array elements
- System.out.println("Accessing Elements of Array:");
- System.out.println("First Element: " + age[0]);
- System.out.println("Second Element: " + age[1]);
- System.out.println("Third Element: " + age[2]);
- System.out.println("Fourth Element: " + age[3]);
- System.out.println("Fifth Element: " + age[4]);
- }
- }
- https://www.programiz.com/java-programming/arrays
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement