You should post the full text of the error message
AND the code that causes the error.
Type: Posts; User: Norm
You should post the full text of the error message
AND the code that causes the error.
Why does the compiler find an error?
Only answer without seeing the code is that it is coded correctly in one and incorrectly in the other.
The compiler is usually correct. Check why.
Without definitions and code, I can't see what is wrong.
eggPrawn.eggPrawn.seteggPrawn
That is unusual looking and confusing code.
pm.aMethodInPizzaMenuClass(); // call a method in PizzaMenu class
Same way you create any class. With an editor or IDE.
Make a small special set of classes for testing, don't use the classes from your assignment.
There are two or three classes and a few methods each. Nothing more is needed.
This way of trying to fix your problems is not going to work. You need to make a small, complete set of classes that show the problem and paste them here along with the error messages.
Does the Pizza class extend that class so that the PizzaBase methods are available in instances of the Pizza class?
That defines a class variable and should not be related to calling a method in the class.
Having it static means all instances of the class that it is in will share the same value instead of each...
Is the setMargheritaCost() method defined in the Pizza class that the compiler sees when it tries to compile the code with the call to setMargheritaCost()?
Then why isn't the compiler finding the definition for that method in the Pizza class?
Use a file explorer type program, find and delete all old versions of the class file and then compile the new version.
Is the correct version of the Pizza class accessible to the compiler so it sees the method definition?
Why create an instance of the Pizza class, set a value in it and then immediately discard...
Please copy the full text of the compiler's error message and paste it here.
Is the correct version of the Pizza class accessible to the compiler so it sees the method definition?