class Temp22
{
static int []years={-80000,-79950,20,70,22,60,58,60,58,65,1950,2005};
public static int[] findMaxdinosaur(int[] years)
{
int[] count = new int[(years.length)/2];
int i=0;
int j=0;
int k=0;
for(i=0;i<years.length;i=i+2)
{
int m=0;
{
for(j=0;j<years.length;j=j+2)
{
if(years[i]>years[j+2])
{
m=m+1;
}
}
}
{
count[k]=m;
k=k+1;
}
}
return count;
}
public static void main(String...s)
{
int[] count=findMaxdinosaur(years);
for(int l=0;l<=783;l=l+1)
{
System.out.println(count[l]);
}
}
}
this code is showing exception "ArrayoutofBound", can anybudy tell me, why??