0

Can you give examples of jumping Statements

When to use break , continue , written

11th Feb 2020, 10:17 PM
US.b
 US.b - avatar
5 Respostas
0
US.b That's just a space, they added a space because they used print instead of println. Println: 1 2 Print without the " ": 12 With: 1 2
11th Feb 2020, 11:37 PM
Odyel
Odyel - avatar
+ 8
for (int i=1;i<6;i++){ if (i==3)break; System.out.print(i+" "); } //Output: //1 2 //Replace break with continue and you get //1 2 4 5
11th Feb 2020, 10:41 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
0
Println right
11th Feb 2020, 10:51 PM
US.b
 US.b - avatar
0
Can you explain why System.out.println (i+" "); dont understand " " part
11th Feb 2020, 10:54 PM
US.b
 US.b - avatar
0
You can also use continue with labels, something similar to goto statements.
12th Feb 2020, 2:16 AM
Avinesh
Avinesh - avatar