Answer:
b. 1 2 3 4 5
Step-by-step explanation:
Let us analyze the given code one statement at a time.
int [] x = {1,2,3,4,5}; // Initializes an integer array x
int [] y = new int [5] ; // Allocates a new integer array y
for (int i : x)
y = x;
This assign the variable y with the array x
for (int i : y)
System.out.print (i + " ");
The content of the attay y is printed one element at a time.
The final output will be as follows:
1 2 3 4 5