all,I\'m now facing the problem of no idea on storing the content in text file into the array. The situation is like, text file content:
abc1 xyz2 rxy3
You can use this code. This works very fast!
public String[] loadFileToArray(String fileName) throws IOException { String s = new String(Files.readAllBytes(Paths.get(fileName))); return Arrays.stream(s.split("\n")).toArray(String[]::new); }