Advertisement
deyanivanov966

WHILE LOOP - LAB 01. Read Text

Apr 1st, 2021
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.33 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class ReadText {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         String input = scanner.nextLine();
  8.  
  9.         while (!input.equals("Stop")){
  10.             System.out.println(input);
  11.             input = scanner.nextLine();
  12.  
  13.         }
  14.     }
  15. }
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement