Advertisement
dxvmxnd

Untitled

Oct 30th, 2023
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. public static int sizeRowFile(String path) {
  2. int sizeI;
  3. boolean isIncorrect;
  4.  
  5. System.out.println("Считывание размера строк......");
  6. sizeI = 0;
  7.  
  8. isIncorrect = false;
  9. try (BufferedReader reader = new BufferedReader(new FileReader(path))) {
  10. sizeI = Integer.parseInt(reader.readLine());
  11. } catch (IOException ioException) {
  12. isIncorrect = true;
  13. }
  14. if ((sizeI < 1) || (isIncorrect = true)) {
  15. isIncorrect = true;
  16. System.err.println("Неверный ввод данных! Измените входные данные и перезапустите программу.");
  17. }
  18.  
  19. System.out.println(sizeI);
  20. reader.close();
  21. return sizeI;
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement