Question: how to extract data from text file in java?
Answer: Using BufferedReader: This method reads text from a character-input stream. ... 
Using FileReader class: Convenience class for reading character files. ... 
Using Scanner class: A simple text scanner which can parse primitive types and strings using regular expressions. ... 
Using Scanner class but without using loops: