private static void readSplitPrint(String path) {
try {
for (String line : Files.readAllLines(Paths.get(path))) {
for (String word : line.split("/t")) {
System.out.println(path + " : " + word);
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
I have a default code for my homework. I need to use it and it works for reading a text file to complete my project. But I have some trouble about this topic. I can't convert a string object which is called 'word' to any string[] object. I'm begginer and I don't know how to do it with using Array easily. So I need to convert and hold these words and -of course it is possible- keep it any String[] or String[][] object to use as "x[0][0]" or "x[2][3]" matrix type. Can anyone help to me?