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 =...



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?



Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here