in flowershop class
-
Cennik c= Cennik.getInstance(); //cennik means pricelist
-
public void addFlower(String n,double c){
-
-
c.setPricelist(n,c);
-
-
}
-
-
in Pricelist class
-
public void setPricelist(String nazwaKwiat,double cena){
-
pricelist.put(nazwaKwiat,cena);
-
}
-
why eclipse says cannot invoke c.setPricelist(String,double) on the prymitive type double
Parameter 'c' is a double, which is a primitive so it doesn't have any methods;
exactly what Eclipse was trying to tell you. I guess you wanted to type:
-
-
// the member 'c' happens to be a PriceList
-
this.c.setPricelist(n,c);
I'd suggest a better name for member variable 'c'; maybe 'priceList' would do?
kind regards,
Jos