Fundamentals13 / 25
Up next

Arrays

import java.util.Arrays;

class Main {
    public static void main(String[] args) {
        int[] a = {10, 20, 30};
        System.out.println(a.length + " " + a[1]);
        // a fresh int array is zero-filled
        int[] zeros = new int[4];
        System.out.println(Arrays.toString(zeros));
    }
}
What you're solving

fixed length, zero-filled by default