Saturday, 3 September 2011

Enhanced For Loop in java


class apples
{
public static void main(String[] args)
{
int arr[]={2,4,6,2,4,7,9};
int total=0;
for(int x: arr)
total+=x;
System.out.print(total);
}
}

No comments:

Post a Comment

Note: only a member of this blog may post a comment.