@@ -0,0 +1,1018 @@
+package array2;%0A%0Aimport java.util.Arrays;%0A%0A/*%0A * Given a number n, create and return a new int array of length n, containing%0A * the numbers 0, 1, 2, ... n-1. The given n may be 0, in which case just return%0A * a length 0 array. You do not need a separate if-statement for the length-0%0A * case; the for-loop should naturally execute 0 times in that case, so it just%0A * works. The syntax to make a new int array is: new int%5Bdesired_length%5D (See%0A * also: FizzBuzz Code)%0A * %0A * fizzArray(4) --%3E %7B0, 1, 2, 3%7D%0A * fizzArray(1) --%3E %7B0%7D%0A * fizzArray(10) --%3E %7B0, 1, 2, 3, 4, 5, 6, 7, 8, 9%7D%0A */%0Apublic class FizzArrayTest %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%0A%09%09FizzArrayTest test = new FizzArrayTest();%0A%09%09System.out.println(Arrays.toString(test.fizzArray(4)));%0A%09%09System.out.println(Arrays.toString(test.fizzArray(1)));%0A%09%09System.out.println(Arrays.toString(test.fizzArray(10)));%0A%09%7D%0A%0A%09public int%5B%5D fizzArray(int n) %7B%0A%0A%09%09int%5B%5D array = new int%5Bn%5D;%0A%0A%09%09for (int i = 0; i %3C n; i++) %7B%0A%09%09%09array%5Bi%5D = i;%0A%09%09%7D%0A%0A%09%09return array;%0A%0A%09%7D%0A%7D%0A

Create FizzArrayTest.java