Bookmark Topic Watch Topic
  • New Topic

help with global array

 
Jeff Yan
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hey all, im having a little trouble. basically im reading an array of integers from a file and putting it into a linked list, then from the linked list im transfering it to an array using the .toArray() method of the arrayList methods. the array is filled with the data, but when i call another method to display the array it is coming up with a null pointer error. ive used System.out.println to test it and the array is of the correct size, and with the correct data in it in the method that reads the data into it, but outside of it the array is "empty" even though it is a global array?! it compiles absolutly fine but with a unsafe operation warning but that is not the issue. my code is below! much appriciated. Jeff.

 
Embla Tingeling
Ranch Hand
Posts: 237
 
Jeff Yan
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Report post to moderator
because nobody was answering it! sorry, i was getting frustrated with it
 
Rob Spoor
Sheriff
Pie
Posts: 20611
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
Then you should ask again for an update in the existing thread, but not within 24 hours. As for creating this thread, use one thread per question. Closing this one.
 
    Bookmark Topic Watch Topic
  • New Topic