In this example we will show the method to access an array in Java.
Source Code
package com.beginner.examples;
public class AccessArray {
public static void main(String[] args) {
String[] strs = {"a", "b", "c", "d"}; // array
strs[0] = "e";
System.out.println(strs[0]);
}
}
Output:
e
References
Imported packages in Java documentation: