Forgot your password?
typodupeerror

Comment Re:The Master Of C (Score 1) 334

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.

Slashdot Top Deals

A sheet of paper is an ink-lined plane. -- Willard Espy, "An Almanac of Words at Play"

Working...