If an object is inside of an object how do I manipulate the object it is inside of
Simple example of what I mean written below
How do I be able to make the mouse manipulate the cage variables (decrease cage strength).
public class Cage{ public Cage(){ cageStrength = 1; Mouse foo = new Mouse (); foo.eat(); } public void changeCageStrength(){ cageStrength--; } } } public class Mouse{ if(condition){ eatPartOfCage(); } } public void eatPartOfCage(){ decrease cage strength; }