Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Q 10, Self test, K and B.

 
K Raj Kumar
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

Output: 4 4

Source: SCJP 6.0 guide(K and B), page 274.
Please help me in understanding the output.
Thanks in advance.
 
jean-gobert de coster
Ranch Hand
Posts: 49
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well, b1 has a size of 5 and b2 has a size of 6, then the go method modified b1 so its size is 4 and then returned a Box[] containing {b2, b1}

then ma[0] = b1 so this is the same as saying b2 = b1

so b1.size = 4 and b2.size = 4, hence the output
 
K Raj Kumar
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jean..

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic