Question: Given the following class definition: public class Zoo { private int cat, lion; public Zoo(int a) { lion = a; cat = 2 * a

 Given the following class definition: public class Zoo { private int

Given the following class definition: public class Zoo { private int cat, lion; public Zoo(int a) { lion = a; cat = 2 * a + 1; } public int stir(int k){ return cat + k * lion ; } public void swirlo int t = lion - 4; lion + cat; cat = t; } public void show() { System.out.println("1 = + lion); System.out.println("C = " + cat ); } } Upload an image of what the object diagram would be after this client code executes. Also, type in what the code would display. Zoo zl = new Zoo(7); zl.show(); Zoo z2 = new Zoo (10); Zoo z3 = z2; 23.show(); z3. swirl); z2.show(); int x = 21.stir(3); System.out.println(x)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!