string array in java methods

Java
String[] cars = {"Volvo", "BMW", "Ford", "Mazda"};
 int[] intArray = new int[]{ 1,2,3,4,5,6,7,8,9,10 }; 
 // Declaring array literalString[] cars = {"Volvo", "BMW", "Ford", "Mazda"};
cars[0] = "Opel";
System.out.println(cars[0]);
// Now outputs Opel instead of Volvo
String[] vowels = { "a", "e", "i", "o", "u" };
System.out.println(vowels);
System.out.println(Arrays.toString(vowels));

Source

Also in Java: