+ 1

Enhanced for Loop

Fill in the blanks to use the enhanced for loop for an array called "arr": int total = 0; for(int x- --) { total += x; }

31st Jan 2018, 2:09 AM
Akiti Wycliffe
Akiti Wycliffe - avatar
1 Réponse
+ 17
int total = 0; for(int x:arr) { total += x; } https://www.sololearn.com/learn/Java/2209/?ref=app
31st Jan 2018, 2:14 AM
Gaurav Agrawal
Gaurav Agrawal - avatar