CJCoding With Joseph
15free / daySign inCreate account
Back to Multiple Choice Quiz

Select topics to narrow your question pool, then enable Random to jump to a random question matching your filters.

Topics

Enhanced For Loop Change

Java quiz · Question 24
mediumArrays

What is printed?

Code

1import java.util.Arrays;
2 
3public class Main {
4 public static void main(String[] args) {
5 int[] nums = {1, 2, 3};
6 
7 for (int x : nums) {
8 x = x * 2;
9 }
10 
11 System.out.println(Arrays.toString(nums));
12 }
13}