Reading a text file in java
问题 How would I read a .txt file in Java and put every line in an array when every lines contains integers, strings, and doubles? And every line has different amounts of words/numbers. I'm a complete noob in Java so sorry if this question is a bit stupid. Thanks 回答1: Try the Scanner class which no one knows about but can do almost anything with text. To get a reader for a file, use File file = new File ("...path..."); String encoding = "...."; // Encoding of your file Reader reader = new