java for array index code example Example: arrays in java int[] intArray = new int[20]; String[] cars = {"Volvo", "BMW", "Ford", "Mazda"};