Array Initializer

A brace-enclosed list of values used to fill an array when it is created.

What is Array Initializer in Java?

Array Initializer — A brace-enclosed list of values used to fill an array when it is created.

class Route {
    String[] stops = {"Oak", "Pine", "Lake"};
    String secondStop = stops[1];
    int stopCount = stops.length;
}

Level: Apprentice · More Java terms at this level

Updated

In other subjects