Advertisement
klasscho

Untitled

Feb 22nd, 2020
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. package com.company;
  2. import java.util.Scanner;
  3.  
  4.  
  5. public class Main {
  6. public static void ReadLine(){
  7. Boolean isNotCorrect = false;
  8. do {
  9. Scanner in = new Scanner(System.in);
  10. System.out.println("Пожалуйста, введите предложение: ");
  11. String inputLine = in.nextLine();
  12. isNotCorrect = false;
  13. if (inputLine.equals(null) || inputLine.equals(" ")) {
  14. System.out.println("Вы ввели пустое преложение. Попробуйте еще раз!");
  15. isNotCorrect = true;
  16. }
  17. } while (isNotCorrect);
  18. }
  19. public static void LineCheck(String inputLine){
  20. Scanner in = new Scanner(System.in);
  21. System.out.println("Пожалуйста, введите предложение: ");
  22. String inputLine = in.nextLine();
  23.  
  24. if (inputLine.equals(null) || inputLine.equals(" ")) {
  25. System.out.println("Вы ввели пустое преложение. Попробуйте еще раз!");
  26.  
  27. }
  28.  
  29.  
  30.  
  31.  
  32.  
  33. }
  34. public static void main (String[]args) throws Exception {
  35. String inputStr;
  36. ReadLine();
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement