What are nested loops/factories?
33
Factory pattern:
a class (or static method) whose job is to construct other objects
Nested for-loop:
Useful for printing 2D grids, iterating over a 2D array (e.g.
int[][]
), or comparing every pair of items from two collections (e.g.
arrays
).