Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Replies
    33
    Views
    2,845

    Re: Setters and getters

    You should post the full text of the error message
    AND the code that causes the error.
  2. Replies
    33
    Views
    2,845

    Re: Setters and getters

    Why does the compiler find an error?
  3. Replies
    33
    Views
    2,845

    Re: Setters and getters

    Only answer without seeing the code is that it is coded correctly in one and incorrectly in the other.
  4. Replies
    33
    Views
    2,845

    Re: Setters and getters

    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.
  5. Replies
    33
    Views
    2,845

    Re: Setters and getters

    pm.aMethodInPizzaMenuClass(); // call a method in PizzaMenu class
  6. Replies
    33
    Views
    2,845

    Re: Setters and getters

    Same way you create any class. With an editor or IDE.
  7. Replies
    33
    Views
    2,845

    Re: Setters and getters

    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.
  8. Replies
    33
    Views
    2,845

    Re: Setters and getters

    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.
  9. Replies
    33
    Views
    2,845

    Re: Setters and getters

    Does the Pizza class extend that class so that the PizzaBase methods are available in instances of the Pizza class?
  10. Replies
    33
    Views
    2,845

    Re: Setters and getters

    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...
  11. Replies
    33
    Views
    2,845

    Re: Setters and getters

    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()?
  12. Replies
    33
    Views
    2,845

    Re: Setters and getters

    Then why isn't the compiler finding the definition for that method in the Pizza class?
  13. Replies
    33
    Views
    2,845

    Re: Setters and getters

    Use a file explorer type program, find and delete all old versions of the class file and then compile the new version.
  14. Replies
    33
    Views
    2,845

    Re: Setters and getters

    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...
  15. Replies
    33
    Views
    2,845

    Re: Setters and getters

    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?
Results 1 to 15 of 15