public class BasicExamRevision1 {
public static void main(String[] args) {
int i, j, z, y, x;
int count = 0;
int RanArray [] = new int[30];
int countArray[] = new int[10];
for(i=0;i<RanArray.length;i++){
RanArray[i] = (int)(Math.random()*90+10);
System.out.println("These are the numbers in the array: at slot "+ (i+1) + " " + "we have: " + RanArray[i]);
}//end of for loop
for(z=0;z<RanArray.length;z++){
for(y=z+1;y<RanArray.length;y++){
if(RanArray[z]>RanArray[y]){
j = RanArray[z];
RanArray[z] = RanArray[y];
RanArray[y] = j;
z=0;
y=0;
}//end of if statement
}//end of y for loop
}//end of z for loop
for(i=0;i<RanArray.length;i++){
System.out.println("The numbers are: " + RanArray[i]);
}//end of i for loop
for(i=0;i<RanArray.length;i++){
for(j=10;j==100;j=j+10){
if(RanArray[i]>=j-10 && RanArray[i]<=j){
countArray[j/10] = countArray[j/10]+1;
}//end of if statement
}//end of j for loop
}//end of i for loop
for(j=0;j<countArray.length;j++){
System.out.println("These are in the certain intervals " + countArray[j]);
}//end of j for loop
}//end of psvm
}//end of public class
I don't understand why the last two nested for loops with countArray wont work because it just keeps returning 0 for all place holders of countArray in the last for loop. I need serious help with it before my exams. Any help will help me alot. I really need it. Thank you.