for (double[] row: array) {
for (double x: row) {
for (double[] col: array) {
for (double y: col) {
System.out.println(array[x][y]);
}
}
}
}
extracted from my code.When I compile in terminal I receive "incompatible types: possible lossy conversion from double to int. I am trying to print out a double[][] as a matrix.
I am required to use afor each loop I know that the indexes have to be ints but how would I make sure they are when i can 't convert doubles to ints?
You can do it like this:
For
Prints