?
package zh.codegym.task.task04.task0402;
/*
苹果的价格
*/
public class Solution {
public static void main(String[] args) {
Apple apple = new Apple();
apple.addPrice(50);
Apple apple2 = new Apple();
apple2.addPrice(100);
System.out.println("苹果的价格为 " + Apple.applePrice);
}
public static class Apple {
public static int applePrice = 0;
public static void addPrice(int applePrice) {
//在此编写你的代码
this.addPrice = addPrice + 100;
}
}
}