0

How can i stop this loop using break?? Having the same output? And without it?

Hello. How can i break a loop without using 'return' nor 'break' in the code? for (int i = 0;; i++) { for (int j = 0; j < 4; j++) { if (i == 2) { return; // } System.out.println("Segundo bucle"); } System.out.println("Primer bucle"); }

10th Mar 2020, 1:41 PM
Pame
Pame - avatar
1 Respuesta
+ 4
for(int i =0;i<3;i++)... you already did it similiar in your last prog👍
10th Mar 2020, 1:44 PM
Oma Falk
Oma Falk - avatar