reading from a file | has syntax //Instantiate a stream, reader and tokenizer FileInputStream streamVariableName = new FileInputStream(fileNameOrPath); InputStreamReader readerVariableName = new InputStreamReader(streamVariableName); StreamTokenizer tokenVariableName = new StreamTokenizer(readerVariableName); //Read from the tokenizer until it is empty while(tokenVariableName.nextToken() != tokenVariableName.TT_EOF) { ... } //Close the file streamVariableName.close(); | |