Advertisement
thenewboston

Java Programming Tutorial - 31 - Enhanced for Loop

Aug 22nd, 2014
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.21 KB | None | 0 0
  1. class apples{
  2.    public static void main(String[] args){
  3.       int bucky[]={3,4,5,6,7};
  4.       int total=0;
  5.  
  6.       for(int x: bucky){
  7.          total+=x;
  8.       }
  9.  
  10.       System.out.println(total);
  11.    }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement