Search:

Type: Posts; User: craigjlner

Search: Search took 0.09 seconds.

  1. Replies
    6
    Views
    1,424

    Re: Cannot print name, getting null error.

    Ok I have this sorted now Norm.:o Thanks for your help.
  2. Replies
    6
    Views
    1,424

    Re: Cannot print name, getting null error.

    Ok I've got scruffy sorted :o
    Now im trying to make a new dog Spot by doing this:



    Spot = new Dog ();
    Spot.setName (Spot);


    but get error:
  3. Replies
    6
    Views
    1,424

    Re: Cannot print name, getting null error.

    I've tried editing the constructor to this:


    //constructor: initializes the instance data name and age:
    public Dog ()
    {
    name = Scruffy;
    age = 14;
    }
  4. Replies
    6
    Views
    1,424

    Cannot print name, getting null error.

    Firstly thanks taking the time to help me out.

    I can compile and run this program but where I want to print the Dogs name and age (with the toString method) it prints only the age, returning...
Results 1 to 4 of 4