I want to modify an array inside different threads, let me explain.
I have a 'parent' thread that contains an array of Objects, initially it's empty. What i want to implement with the multithread is a way of filling in this array. For example, thread one will make requests and fill positions 0-20, thread 2 21-40 and so on. In C this would be easy, i would just pass the pointer and work from there.
Since java does not allow it i don't know how to do it. I can't return anything from the run(), nor pass it as parameter in the thread constructor since the array wont be accessible from the thread above. I hope someone knows a clean way to do so.
myclass extends thread and overrides the run.