import java.io.*; public class ReadWords { public static void main(String[] args) { try { FileInputStream fstream = new FileInputStream("test.txt"); DataInputStream in = new DataInputStream(fstream); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String strLine = null; while ((strLine = br.readLine()) != null) { int i, counter=0; String m[]=strLine.split(" "); System.out.println("Here are the words in the file:"); for(i=0;i