// Stupid code to illustrate Scanner. Does not do anything really reasonable import java.util.Scanner; import java.io.File; import java.io.FileNotFoundException; public class ScannerTest { public static void main (String[] args) { try { Scanner lineReader = new Scanner(new File("ordrad.txt")); while (lineReader.hasNextLine()) { Scanner rowReader = new Scanner(lineReader.nextLine()); String word = rowReader.next(); WordInfo wi = new WordInfo(word); while (rowReader.hasNextInt()) { wi.addRow(rowReader.nextInt()); } wi.print(); } } // Add better error handling!! catch (FileNotFoundException e) { System.out.println("Problem reading " + e); } } }