Answer:
A
Explanation:
The value will be the original stored in the int variables. This is because the method swap(int xp, int yp) accepts xp and yp parameters by value (They are passed by value and not by reference). Consider the implementation below:
public class Agbas {
public static void main(String[] args) {
int xp = 2;
int yp = xp;
swap(xp,yp); //will swap and print the same values
System.out.println(xp+", "+yp); // prints the original in values 2,2
int xp = 2;
int yp = 5;
swap(xp,yp); // will swap and print 5,2
System.out.println(xp+", "+yp); // prints the original in values 2,5
}
public static void swap(int xp, int yp){
int temp = xp;
xp = yp;
yp = temp;
System.out.println(xp+", "+yp);
}
}