I know that the main class is passing-in values. The first value passed in, 50, was canceled out and replaced with 100.
How do I keep the 50 value?
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); //pass value to add price
Apple apple2 = new Apple();
apple2.addPrice(100); //pass value to add price
System.out.println("Apple price " + Apple.applePrice);
}
public static class Apple {
public static int applePrice = 0; //instance variable
public static void addPrice(int applePrice) {
//write your code here
//increase cost of apples by the passed-in value
//50 was cancelled out??
Apple.applePrice = applePrice + applePrice;
}
}
}