Slashdot Mirror


User: hazel_fiver

hazel_fiver's activity in the archive.

Stories
0
Comments
1
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 1

  1. Re:The Master Of C on Which Coding Framework for Mac OS X ? · · Score: 1
    Java doesn't work that way. Every "new" invocation would create a new Ball object:
    e.g. new Ball("Red"); new Ball("Blue"); would always create two Ball objects.

    Perhaps the member variable you used for the colour was a static/class variable?

    For instance:
    class Ball {
    static String colour;

    Ball(String c)
    {
    colour = c;
    }
    .
    .
    .
    }
    would cause the behaviour you described.