By the way I just noticed that you loop the array the wrong way:
for(int i=0; i<rows; i++) {
for(int j=0; j<i; j++) {
System.out.println(finalTemp[i][j]);
}
}
You have at the inner loop: j<i Why? Why do you set the upper limit to be i? It should be the length of the array you are trying to read. With the way you have it, the first loop will not print anything since i would be 0. The next loop will print only one element. You need to put the length of the array. At the outer loop you put the length of finalTemp but in the inner loop the array you are looping is: finalTemp:
// rows is in fact finalTemp.length
for(int i=0; i<rows; i++) {
for(int j=0; j<finalTemp[i].length; j++) {
System.out.println(finalTemp[i][j]);
}
}
finalTemp is also an array and you want to print its elements: finalTemp[j] . So its length would be: finalTemp.length
I assume that since the thread is marked as solved you have corrected that error on your own. But in case you didn't I posted