On Monday, 3 December 2018 at 22:04:25 UTC, Neia Neutuladh wrote:
On Mon, 03 Dec 2018 21:27:52 +0000, faissaloo wrote:
Then shouldn't the following output false, false, true?

An object reference is a pointer value. The pointer values are copied. The pointed-at objects are not copied.

Furthermore, the syntax

    Object[6] array = new Object();

only allocates one Object. Each item in the array is an object reference to the same object.

Oh great, thanks for clearing this up.

I also didn't know about shorthand only allocating one object (the code he shared was a piece of code we were testing with which I mistakenly wrote!)

Thanks!

Reply via email to