I am having some issues understanding what Java wants syntactically for the program to work. The program is supposed to read the input file and then print out its contents. Once I do that, I will know how to manipulate its contents.
For example, my input file could look something like this:
1 2 3
4 5 6
7 8 9
This is my code:
import java.util.Scanner;
import java.io.*;
public class stats1 {
public static void main(String[] args) throws IOException {
Scanner s = new Scanner(new File("numbers.tex"));
int[][] numbers = new int[s.nextInt()][s.nextInt()];
for (int row = 0; row < numbers.length; row++)
for(int col =0; col < numbers[row].length; col++)
numbers[row][col]=s.nextInt();
System.out.print(numbers[row][col] + " ");
}
}