File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes help with global array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic

help with global array

Jeff Yan
Ranch Hand

Joined: Nov 05, 2009
Posts: 42
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.

~ Jeff Yan ~
Embla Tingeling
Ranch Hand

Joined: Oct 22, 2009
Posts: 237
Jeff Yan
Ranch Hand

Joined: Nov 05, 2009
Posts: 42
because nobody was answering it! sorry, i was getting frustrated with it
Rob Spoor

Joined: Oct 27, 2005
Posts: 20274

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.

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: help with global array
It's not a secret anymore!