Array access outside loop | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Array access outside loop

Hi I have the attached code and I want to access the item elements or all zeroz outside the for loop. Outside the for loop I want all the zeroz not one zero. How do I do that? https://code.sololearn.com/cWXc6y06g2m4/?ref=app

19th Dec 2022, 4:06 PM
Sibusiso Mbambo
4 Answers
+ 2
Do this System.out.println(Arrays.toString(yourArray));
19th Dec 2022, 4:13 PM
A͢J
A͢J - avatar
+ 2
Sibusiso Mbambo Arrays is a class in util package so you have to import it.
19th Dec 2022, 4:20 PM
A͢J
A͢J - avatar
+ 2
Thanks, got it!
19th Dec 2022, 4:21 PM
Sibusiso Mbambo
0
I've edited the code with your suggestion but I'm getting an error.
19th Dec 2022, 4:17 PM
Sibusiso Mbambo