SyntaxFix
Write A Post
Hire A Developer
Questions
We can do a nested loop to visit all the elements of elements in your list:
for (Gun g: gunList) { System.out.print(g.toString() + "\n "); for(Bullet b : g.getBullet() { System.out.print(g); } System.out.println(); }