1.
public static void addPrice(int applesPrice) {
this.applesPrice = this.applesPrice + applesPrice;
//напишите тут ваш код
}
Не работает.
2.
public static void addPrice(int applesPrice) {
Apple.applesPrice = Apple.applesPrice + applesPrice;
//напишите тут ваш код
}
Работает.
Почему так? Объясните, пожалуйста!