This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hello ranchers I was trying to do some experiment on multi dim array I will let you all know that i am trying to add values of 2 multi dimensional array in a method and the return type of that method is a 2 dimensional array i am expecting s[ome]thing different but the output wat i am getting is s[ome]thing else pl[ease] help me here is the code
[HENRY: Removed unnecessary code tags and got rid of illegal abbreviations] [ January 15, 2007: Message edited by: Henry Wong ]
Impossible is Nothing<br />SCJP 1.4: 96%
Joined: Nov 13, 2006
[op] i am expecting the output as 2 4 6 8 10 12 14 16 18 [/op] [ap] but the output is 2 4 8 10 please help me to get the output as mentioned above thank you [/ap]
What Henry want you to do is to look at the for loops where you are printing the array. The upper limits of the loops are incorrect. "j<arr.length-1" should be "j<arr.length". The same thing holds for the outer for loop.
You can also print your arrays like this:
[ January 15, 2007: Message edited by: Barry Gaunt ]