0

hi is there a loop in java called (foreach)

java

28th May 2017, 6:58 AM
robert kiprotich
robert kiprotich - avatar
2 ответов
+ 3
not as such foreach( syntax is different ) but working is same here is the example // data is an array for (int a : data) { System.out.print(a+ " "); }
28th May 2017, 7:10 AM
Mandeep Singh
+ 1
There is also a forEach method on the collections that takes a lambda.
28th May 2017, 7:17 AM
1of3
1of3 - avatar