1. Engineering
  2. Computer Science
  3. 9 what is the exact output produced by running the...

Question: 9 what is the exact output produced by running the...

Question details

9. What is the exact output produced by running the method test? public class Testswap public vold swap (int x, int y int terp; temp xi ytempi Syaten.out printin(Inside sxap version 1i System.out.printlnxx) System.out.printiniy-) public void awap (antl) a, int i, int j) int terp temp a1i a 131 temp System.out printin(Inside swap verason 2 Systen . out . printin (al + i + I- * a【i]} System.out printinlal+ -+al31) public void printArray (int!! a) Systen.out.print (Atray elenents: for lint i” 0; i <alengthi i..) + . It Systen.out-Print(a[i] ystem.out.printin public static void test 0 Testswap t ne TestSvapt) tinal int ARRAY SI2E 3 int[]arr. new int [ARRAYSIZE) - , arrlil7 int x-0, y-2; e-printhrray (arz) t.swap (x, y) System.out.printin (Inside test:) System.out.printinxx) System.out.printin (y y) t.printArray (arr) t.swap (aerlx), arrlyl) t.printArzay (are): t.swap (arr, x, y); t.printArray (arr)
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution