public class Final { public static void main(String[ args) { int al = {7, 3, 14, 8, 19, 4, 8, 9 }; method2 (a, 5); metho
Posted: Sat May 14, 2022 4:49 pm
public class Final { public static void main(String[ args) { int al = {7, 3, 14, 8, 19, 4, 8, 9 }; method2 (a, 5); method1(a,5); } public static void method2(int b[], int len) { int temp; for (int i=0; i<len/2; i++) { temp=b; b=b[b.length -i-1]; b[b.length -1 -1 ]=temp; } } public static void method 1(int b[], int len) { for (int k=len-1; k>=0; k=k-2) System.out.printf( "%3d", b[k]); System.out.println(); } } 19 14 7 O 19 14 9 19 14 8 0 19 14 4