What are the values of x and y after executing the code snippet below?
public static void swap(int a, int b) {
int t = a;
a = b;
b = t;
}
public static void main(String[] args)
{
int x = 10;
int y = 11;
swap(x, y) ;
}
A) x = 10 and y = 11
B) x = 11 and y = 10
C) x = 0 and y = 0
D) x = 11 and y = 11
Correct Answer:
Verified
Q32: Suppose you need to write a method
Q33: Which of the following options represents the
Q34: Which of the following is true about
Q35: Which of the following is not legal
Q36: The Math.ceil method in the Java standard
Q38: What are the values of num1 and
Q39: What is the output of the following
Q40: What can be used as an argument
Q41: What step should you take after implementing
Q42: Given the following code, what is the
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents