Hi there, I added the sout on line 11 so that when I run it I can see the results of the increases by the passed-in value
I would appreciate it if anyone could tell me why is this wrong?
thanks
package en.codegym.task.jdk13.task04.task0402;
/*
Price of apples
*/
public class Solution {
public static void main(String[] args) {
Apple apple = new Apple();
apple.addPrice(50);
System.out.println("Apple price " + Apple.applePrice);
Apple apple2 = new Apple();
apple2.addPrice(100);
System.out.println("Apple price " + Apple.applePrice);
}
public static class Apple {
public static int applePrice = 0;
public static void addPrice(int applePrice) {
Apple.applePrice = applePrice;
}
}
}