plz explain your answer
java
System.out.println (sum) [ ] 0 ] 1 I] 2 [ ] 3 [ ] 6 [ 18 14 None of the above What is the output of this code? public class Test( public static void main (String [Jargs) int x= 3; (19 int y= 7 int z swap (x, /y) System.out.println(z); public static int swap (iint x, int y) int temp=Yi Y= x; temp; X = return X + y } [] 3 [] 7 [] 10 The code won’t run because the new keyword was not u [] None of the above Show transcribed image text System.out.println (sum) [ ] 0 ] 1 I] 2 [ ] 3 [ ] 6 [ 18 14 None of the above What is the output of this code? public class Test( public static void main (String [Jargs) int x= 3; (19 int y= 7 int z swap (x, /y) System.out.println(z); public static int swap (iint x, int y) int temp=Yi Y= x; temp; X = return X + y } [] 3 [] 7 [] 10 The code won’t run because the new keyword was not u [] None of the above
Expert Answer
Answer to System.out.println (sum) [ ] 0 ] 1 I] 2 [ ] 3 [ ] 6 [ 18 14 None of the above What is the output of this code? public cl…