Search:

Type: Posts; User: maths94

Search: Search took 0.17 seconds.

  1. Replies
    33
    Views
    2,932

    Re: Setters and getters

    Exception in thread "main" java.lang.NullPointerException
    at PizzaChoice.main(PizzaChoice.java:150)

    and if (bacon.getType().equals("bacon")||(prawn.getType().equals("prawn"))) {

    sorry about...
  2. Replies
    33
    Views
    2,932

    Re: Setters and getters

    Do you know why



    boolean vegetarian = true;
    if (bacon.getType().equals("bacon")||(prawn.getType().equals("prawn"))) {

    vegetarian = false;
    System.out.println("This...
  3. Replies
    33
    Views
    2,932

    Re: Setters and getters

    Well i showed the code in a previous post, i've went over and over and they're definitely the same
  4. Replies
    33
    Views
    2,932

    Re: Setters and getters

    Yeah but the compiler is telling me that "The method geteggPrawn() is undefined for the type Pizza" yet it works for the other without an error, even though i don't have get method in pizza, it's in...
  5. Replies
    33
    Views
    2,932

    Re: Setters and getters

    dddddddddddddddddddddddddddddd
  6. Replies
    33
    Views
    2,932

    Re: Setters and getters

    I've already got this down at the moment, but different object name. Can you show an example of using pm with method, please?
  7. Replies
    33
    Views
    2,932

    Re: Setters and getters

    I know how to create a class =/ i mean i don't know how to test each class, just call the class?
  8. Replies
    33
    Views
    2,932

    Re: Setters and getters

    How can i do my testing class =/ cheers
  9. Replies
    33
    Views
    2,932

    Re: Setters and getters

    Is it ok that when you've looked at it, and if the problem is resolved. Can i edit my post and remove the code? don't want others stealing you see..
  10. Replies
    33
    Views
    2,932

    Re: Setters and getters

    It won't allow me to do that, receive an error message "Implicit super constructor PizzaBase() is undefined for default constructor. Must define an explicit constructor"
  11. Replies
    33
    Views
    2,932

    Re: Setters and getters

    The method is defined in the PizzaBase class, so how can i define it in both, i'm required to use extend on pizza because it contains all the toppings that i'll need
  12. Replies
    33
    Views
    2,932

    Re: Setters and getters

    I kinda just copied the way i done with my other getters and setters. So in my Pizza class the only thing i have related to this is
    static public double MargheritaCost;
  13. Replies
    33
    Views
    2,932

    Re: Setters and getters

    Are you sure i don't it correctly ? sorry i'm just becoming really aggravated, i haven't progressed in 3 days and it needs to be done for friday. Becoming worried ;p
  14. Replies
    33
    Views
    2,932

    Re: Setters and getters

    I've deleted the others, but it's definitely the correct one
  15. Replies
    33
    Views
    2,932

    Re: Setters and getters

    I may sound like an idiot, but how do you check =/
  16. Replies
    33
    Views
    2,932

    Re: Setters and getters

    The method setMargheritaCost(double) is undefined for the type Pizza

    I'm using extends


    public class PizzaMenu extends Pizza {

    void Margherita ()
    {
    Pizza p=new Pizza();
  17. Replies
    33
    Views
    2,932

    Setters and getters

    I'm trying to try and set the cost of the pizza, in one class i have :


    public double MargheritaCost;
    public void setMargheritaCost(double MargheritaCost) {
    this.MargheritaCost =...
Results 1 to 17 of 17