Using an example:
Let say I have a class call Gun. I have another class call Bullet.
Gun
Bullet
Class Gun has an
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(); }