In the Bag class, we created a static global variable called designer and created static getters and
Question:
In the Bag class, we created a static global variable called designer and created static getters and setters for it. What if we made these methods nonstatic instead?
a. Remove the static keyword from getDesigner() and setDesigner(). Now they are instance methods.
b. In the BagStore.java code, try calling the getDesigner() method from the blueBackpack and the pinkPurse objects. What happens?
c. Use the setter method to reassign a new value to the designer variable. Call the setter from blueBackpack. Afterwards, print the value of designer using the getter from blueBackpack and pinkPurse objects. What happens and why?
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Question Posted: