Search:

Type: Posts; User: curmudgeon

Search: Search took 0.10 seconds.

  1. [SOLVED] Re: Another question abt mutators and accessors...

    You should show what is wrong with your current code. What output are you seeing vs. what are you expecting.
  2. [SOLVED] Re: Another question abt mutators and accessors...

    There you go!



    You should be able to fix your harness so that it now works.
  3. [SOLVED] Re: Another question abt mutators and accessors...

    Have a look at the method tutorial to see how to write methods. The parameter always needs it's type declared, and in fact you've done this with your other methods, and in fact already did it with...
  4. [SOLVED] Re: Another question abt mutators and accessors...

    Yep, and again the compiler is right. Again, don't use a String parameter for this method. What parameter type should you use instead?

    Note: you should not have a parameter named "Cat" as this...
  5. [SOLVED] Re: Another question abt mutators and accessors...

    Oh, I see what you did. You need to get rid of that cat variable:


    private String cat; // Java made me add this variable for whatever the reason (the previous code used didn't work for some...
  6. [SOLVED] Re: Another question abt mutators and accessors...

    The compiler can't compile that code, not unless you changed the Gorilla pet variable to a String variable, and hopefully you didn't do this. You need to show us how you "fixed" your Gorilla class.
  7. [SOLVED] Re: Another question abt mutators and accessors...

    No, that shouldn't work, and the compiler is as usual correct. You're trying to assign a String to a Pet variable, and that won't work. You can only assign a Pet object to a Pet variable. Notice how...
Results 1 to 7 of 7