This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Is the reason the equality test COMPILES because f3 and f2[2] are considered object references? I initially thought this might not compile because the array sizes were different.
Is the reason the equality test COMPILES because f3 and f2[2] are considered object references? I initially thought this might not compile because the array sizes were different.
Yes.You're comparing their address not any element.
-hth
OCA7
Praveen Kumar M K
Ranch Hand
Joined: Jul 03, 2011
Posts: 256
posted
0
R Gle wrote:given the code segment:
and the test for equality...
Is the reason the equality test COMPILES because f3 and f2[2] are considered object references? I initially thought this might not compile because the array sizes were different.
f2 is an array of arrays, therefore the individual elements within this collection should also be arrays, correct? So when you access f[2] you are accessing an array at the 2nd position, so it should compile.
How about trying if(f2 == f3) {}?