Question: Using a for loop, fill the array a with 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0,
Using a for loop, fill the array a with 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2. Complete the code below.
Complete the following file:
import java.util.Arrays;
public class Fill { public static void main(String[] args) { int[] a = new int[18]; for (. . .) { a[i] = . . .; } System.out.println(Arrays.toString(a)); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
