私はこの形式のファイルを持っています。 50 xxx/70 aaa/90 ccc/スキャナnext()をパラメータとして
プログラムはデフォルトのディレクトリにファイルを保存します。同じディレクトリから読み込もうとしています。しかし、何もスキャンしません...何が間違っていますか?申し訳ありませんプログラムでうまくいきません
私は50に "先行" xxxを "テキスト"に読んで、aPf.insert(先行、テキスト)でこれら2つのものを使用したいと思います。
File file = new File("poznamky.txt");
Scanner scanner = null;
int prior;
String text;
try {
scanner = new Scanner(file);
scanner.useDelimiter("/");
while (scanner.hasNext()) {
prior = scanner.nextInt();
text = scanner.next();
aPf.insert(prior, text);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}
ああ、私はaPfを作成しました.... –