Search:

Type: Posts; User: Norm

Search: Search took 0.08 seconds.

  1. Replies
    12
    Views
    1,993

    [SOLVED] Re: Question about using the toString method.

    toString() is a method in a lot of classes. For what class are you trying to call its toString() method?
    You call the toString()method like any other method:
    String aStr = refToClass.toString();
  2. Replies
    12
    Views
    1,993

    [SOLVED] Re: Question about using the toString method.

    Do you understand what the scope of definition for a variable is? You can not use a variable if it is not defined or if the definition for the variable is out of scope (not inside of the enclosing...
  3. Replies
    12
    Views
    1,993

    [SOLVED] Re: Question about using the toString method.

    Yes, faceName is defined inside of the toString() method. Do you get an error with the code in post#7?
  4. Replies
    12
    Views
    1,993

    [SOLVED] Re: Question about using the toString method.

    Where is the variable faceName defined? You can not use a variable whose definition is not in scope at that location.
  5. Replies
    12
    Views
    1,993

    [SOLVED] Re: Question about using the toString method.

    Use the return statement with the String you want to have returned by the method. Look at the toString() method in the Coin class. It returns the String: faceName.
Results 1 to 5 of 5