Skip to content

Instantly share code, notes, and snippets.

@carlosmaniero
Created March 16, 2017 01:58
Show Gist options
  • Save carlosmaniero/262ca4adab862dbe3c9556508a58bd39 to your computer and use it in GitHub Desktop.
Save carlosmaniero/262ca4adab862dbe3c9556508a58bd39 to your computer and use it in GitHub Desktop.
public class Sum {
public static void main(String args[]) {
int[] array = new int[]{1, 2, 3, 4, 5};
int sum = 0;
for (int item: array) {
sum += item;
}
System.out.println(sum);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment