I'm trying to try and set the cost of the pizza, in one class i have :
then in another class i havepublic double MargheritaCost; public void setMargheritaCost(double MargheritaCost) { this.MargheritaCost = MargheritaCost; } public double getMargheritaCost() { return MargheritaCost; }
this does not set the cost and i get an error message informing me to create a methodvoid Margherita () { Pizza p=new Pizza(); p.setMargheritaCost(5.49); }
anyone got any ideas where i'm going wrong? thanks