Java 建立一個具有初始值的陣列

public class CreateArrayWithValues {
    public static void main(String[] args){
        // Initializes an array of Strings with values
        String[] myArray = {"this", "array", "has", "six", "initial", "values"};
        System.out.println("myArray.length = "+myArray.length);
        // Print out each value of myArray
        for(int index = 0; index < myArray.length; index++){
            System.out.print(myArray[index]);
        }
    }
}