Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package whileLoops;
- import java.util.Scanner;
- public class P01ReadText {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String input = scanner.nextLine();
- while (!input.equals("Stop")) {
- System.out.println(input);
- input = scanner.nextLine();
- }
- // while (true) {
- // String input = scanner.nextLine();
- // if (input.equals("Stop")) {
- // break;
- // }
- // System.out.println(input);
- // }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement