Is it Possible? Array elements Initialized in Loop, can it be viewed outside loop?
I'm currently making a database of which you can add names (in an array), list them, edit them and delete them individually.
I have used a loop to add the names to the array, however since the names are added to the array initializing inside the loop, I cannot view/print/use these names
outside the loop.
Is there any way of getting the various elements of the array to stay initialized within and outside the loop? or is there another way?
Thanks for any replies! - I really need help - I'm a beginner.
Re: Is it Possible? Array elements Initialized in Loop, can it be viewed outside loop
You should define the array variable outside of the method so that all methods can see it and its contents.
You can assign it values any where in your code.