Consider the following method. Java.
public void changeValues(int i, Card c){ i = 15; c.setSuit(“Clubs”);}
Now consider the following snippet of code that calls the method defined above.
int num = 12;Card fiveOfSpades = new Card(5, “Spades”);System.out.println(“Before method call:”);System.out.println(num);System.out.println(fiveOfSpades.getSuit());changeValues(num, fiveOfSpades);System.out.println(“After method call:”);System.out.println(num);System.out.println(fiveOfSpades.getSuit());
What is the output of this code?
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here