Jean-Francois Alban

+ Follow
since Apr 13, 2011
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jean-Francois Alban

Well done dmc!
Thanks for Sharing!!
10 years ago
That's correct.
Naturally I would have assume that at runtime the JMV would sort it out and use MySubObj.
Hi guys

Here's a code we were playing with at the office.
What do you think is the expected outcome (no cheating don't run).
Also please provide a why to your answer. Thanks guys!!

Well done! Thanks much for sharing it with us! It helps!!
10 years ago

Matthew Brown wrote:3?

You're creating two CardBoard objects (two new statements). Each of those also contains a Short (200 is out of the range where Shorts are cached, I think). That makes four objects created.

You end up with one live reference to a CardBoard object (c2), but that's still got a reference its Short.

[I'm assuming that ClassBoard = CardBoard - otherwise the answer is "does not compile" ]

ClassBoard... good catch man!!