I am fairly new to programming so layman\'s talk is appreciated.
I have been tasked to read the contents of a file, which will contain 9 values (3x3 array) and then
You're missing an extra step here.
Once you read the line, you have to then split the line and parseDouble on individual numbers.
int lineCount = 0;
while ((line = bf.readLine()) != null)
{
String[] numbers = line.split(" ");
for ( int i = 0 ; i < 3 ; i++)
matrix[lineCount][i] = Double.parseDouble(numbers[i]);
lineCount++;
}
Also, your readFile doesn't need to return anything. Just make your matrix variable global.