Name: Anonymous 2006-04-26 23:26
Poop x = new Poop(6);
Poop y = new Poop(123);
x.Print(); // output is 6
y.Print(); // output is 123
x = y; // was object copied from y to x?
x.Print(); // output is 123
y.Print(); // output is 123
y.P = 5555; // well, let's see...
x.Print(); // output is 5555 *
y.Print(); // output is 5555
// no -- x now references same object that y is
// so objects are treated as pointers... no biggie
// ... but how do I use = in a "copy" kind of way?
Poop y = new Poop(123);
x.Print(); // output is 6
y.Print(); // output is 123
x = y; // was object copied from y to x?
x.Print(); // output is 123
y.Print(); // output is 123
y.P = 5555; // well, let's see...
x.Print(); // output is 5555 *
y.Print(); // output is 5555
// no -- x now references same object that y is
// so objects are treated as pointers... no biggie
// ... but how do I use = in a "copy" kind of way?