Advertisement
veronikaaa86

01. Read Text - v.01

Jul 30th, 2022
1,051
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.38 KB | None | 0 0
  1. package whileLoop;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class P01ReadText {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.  
  9.         while (true) {
  10.             String word = scanner.nextLine();
  11.  
  12.             if (word.equals("Stop")) {
  13.                 break;
  14.             }
  15.  
  16.             System.out.println(word);
  17.         }
  18.  
  19.     }
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement