please paste your code so we can help point to the right direction

there's plenty of examples online, one of it
Nested Loops (Nested for , Nested While, Nested do-while) - Java Examples and...