1、从文件中读取三行数据
String[] lines = new String[3]; boolean readPointerFileSuccess = true; try (Scanner scanner = new Scanner(pointerFile)) { for (int i = 0; i < lines.length; i++) { if (scanner.hasNextLine()) { lines[i] = scanner.nextLine(); } else { readPointerFileSuccess = false; } } }
时间: 2024-10-12 14:41:17