报错是数组下标超过范围但是我不知道怎么超了
public class HelloWorld {
public static void main(String[] args){
int num[]=new int[]{61,23,4,74,13,148,20};
int B=num[0];
int S=num[0];
int sum=0;
double avg=0;
int i;
for(i=0;i<num.length;i++);{
sum=sum+num[i];
if(B<=num[i]){
B=num[i];
}else if(S>=num[i]){
S=num[i];
}
}
avg=sum/7;
System.out.println(B+S+sum+avg);
}
}哪里出问题了??