Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Head First Java Code Magnets Chapter 3 Q

 
andrew dale
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Head First Java Code Magnets Chapter 3 Q

Ok, so thanks to everyone contributing to all my questions... I got my first I guess you can call it quiz, from the book CORRECT ! (Woohoo!)

Now I understand most of the code except for 1 little part, ill post the whole thing and have the question at the bottom.



I got it first Try!!!

Anyway the problem I don't understand is
ref = index[y].... I know it's linking to a lot of other things, but I just can't understand it!

If someone can explain everything that it is doing it would be very helpful, thank you!
 
Raymond Tong
Ranch Hand
Posts: 255
2
IntelliJ IDE Java Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
y is incremented by 1 in each iteration which gives
 
suryakanta sahoo
Greenhorn
Posts: 5
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simplified code
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic