Hello everyone,
I don't understand why my solution to this task can't meet the requirement to completed it although my result is correct. Is there someone who could explain me why ?
I am looking forward to reading your answers. Thank you
package fr.codegym.task.task04.task0402;
/*
Prix des pommes
*/
public class Solution {
public static void main(String[] args) {
Pomme pomme = new Pomme();
pomme.ajouterPrix(50);
Pomme pomme2 = new Pomme();
pomme2.ajouterPrix(100);
System.out.println("Le coût des pommes est de " + Pomme.prixPomme);
}
public static class Pomme {
public static int prixPomme = 0;
public void ajouterPrix(int prixPomme) {
this.prixPomme += prixPomme;
}
}
}