- Array Simulation 002 Consider The Following Method Public Static Void Arraymystery String A For Int I 0 I A 1 (62.2 KiB) Viewed 117 times
Array Simulation 002 Consider the following method: public static void arrayMystery (String[] a) { for(int i = 0; i < a.
-
- Posts: 43759
- Joined: Sat Aug 07, 2021 7:38 am
Array Simulation 002 Consider the following method: public static void arrayMystery (String[] a) { for(int i = 0; i < a.
Array Simulation 002 Consider the following method: public static void arrayMystery (String[] a) { for(int i = 0; i < a.length; i++) { a = a[a.length - 1 - i]; } } Indicate in the right-hand column what values would be stored in the array after the method arrayMystery executes if the array in the left-hand column is passed as a parameter to it. Original Contents of Array Final Contents of Array string[] a1 = {"a", "b", "c"}; arrayMystery (al); String[] a2 = {"a", "bb", "c", "dd"}; arrayMystery (a2); String[] a3 = {"z", "y", "142", "w", "xx"}; arrayMystery (a3);