The moose likes Java in General and the fly likes help with global array Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

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
Doubleposted,

http://www.coderanch.com/t/471019/Beginning-Java/java/Global-Array-not-working-please
Jeff Yan
Ranch Hand

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

Joined: Oct 27, 2005
Posts: 19216

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.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: help with global array
 
Similar Threads
Global Array not working
Currency Problem + General Advice
reading a user chosen file into array
reading a user chosen file into array - multiple files
Overhead IO : The cryptic case of the extra bytes