Java “Get” and “Set” Methods
问题 I have two classes, in class Player i have the variable which is defined as private int collectedDots and I want to access in another class Exit . I have defined the Get and Set method within class Player as such: public void setCollectedDots(int cd) { collectedDots = cd; } public int getCollectedDots() { return collectedDots; } But now I want to access the collectedDots field from the Exit class. When I copy those two methods into the Exit class I keep getting the error cannot find symbol -