Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Array element getting null itself

nested loop array element null

  • Please log in to reply
1 reply to this topic

#1 toto_7

toto_7

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 244 posts

Posted 19 May 2011 - 04:16 PM

Hello,
i have 2D array and initialise it with nested loop. More specific in place array[11][2] initialise it as element of another class i created. Now if i use system.out to print this place after the end of loop, content is ok, but if i print it in a method i created is null!!! Im not doing anything in that place in that method, just system.out. Any idea???
thank you

EDIT: Noticed that in method all elements of the array are NULL.Why? when that happens?
  • 0

"Programming is like **. One mistake and you have to support it for the rest of your life."

-Michael Sinz

#2 ZekeDragon

ZekeDragon

    CC Leader

  • Retired Mod
  • PipPipPipPipPipPipPip
  • 1263 posts

Posted 19 May 2011 - 05:06 PM

That sounds unusual, could you provide a code example that shows the problem? Sometimes when distilling code you're working on into an example, you find the problem on your own. :)
  • 0
If you enjoy reading this discussion and are thinking about commenting, why not click here to register and start participating in under a minute?





Also tagged with one or more of these keywords: nested loop, array, element, null

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download