別々のファイルに出力したい 2 つの配列があります。これが私のコードです:
try {
PrintStream out = new PrintStream(new FileOutputStream(
"Edges.txt"));
for (i = 0; i < bcount; i++) {
out.println(b[i][0] + " " + b[i][1]);
}
out.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
} catch (Exception ex) {
ex.printStackTrace();
}
try {
PrintStream out = new PrintStream(new FileOutputStream(
"Nodes.txt"));
for (i = 0; i < bigbIter; i++) {
out.println(bigb[i]);
}
out.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
} catch (Exception ex) {
ex.printStackTrace();
}
try / catch / catch の最初のセットのみを使用すると、完全に機能します。しかし、両方を使用すると機能せず、「型の不正な開始 ... } キャッチ」および「エラー: クラス、インターフェイス、または列挙型が必要です」というエラーが表示されます。私は何を間違っていますか?