Page 1 of 1

Array Simulation 002 Consider the following method: public static void arrayMystery (String[] a) { for(int i = 0; i < a.

Posted: Fri Jun 10, 2022 11:54 am
by correctanswer
Array Simulation 002 Consider The Following Method Public Static Void Arraymystery String A For Int I 0 I A 1
Array Simulation 002 Consider The Following Method Public Static Void Arraymystery String A For Int I 0 I A 1 (62.2 KiB) Viewed 120 times
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);