0

(Java) How can I instance a local array from another class ?

My problem is that I have an array where user can choose how long it is, so it's declared inside a method, what I dont know is how to use this array's data from other class.

20th Apr 2019, 2:17 AM
Matias
Matias - avatar
1 Odpowiedź
+ 1
declare the array as instance variable (member variable) initialize it using your method, then create a getter method to access the array
20th Apr 2019, 3:05 AM
Taste
Taste - avatar