Skip to content
Quiz · Arrays · lesson 6 of 8

Quiz — two references to an array

Question 1 of 2

What does the program print?

JAVA
public class Main {
    public static void main(String[] args) {
        int[] a = {1, 2, 3};
        int[] b = a;
        int x = a[1];
        b[0] = 9;
        x = 7;
        System.out.println(a[0] + " " + a[1]);
    }
}