Java Arrays Evaluation

Questions on Arrays

1. Array Declaration and Initialization

Explain how to declare and initialize an array in Java. Provide an example that declares an integer array and initializes it with values.

2. Accessing Array Elements

Describe how to access elements in an array in Java. Write an example that accesses and prints each element of an integer array.

3. Array Length

Explain how to find the length of an array in Java. Provide an example that demonstrates how to get and print the length of an integer array.