Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Array copy  RSS feed

 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am copying two arrays, but the printout elements are different.

Thanks
 
Ranch Hand
Posts: 47
 
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's a better solution for sure, but I'm curious why your code didn't do what you wanted. Any chance the numberOfCells and cellsPointerNumber don't have the values you think they do? Try just using array.length instead and see what happens.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!