veronikaaa86

Concat Char Two

Mar 3rd, 2018
864
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Test {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         String input = "";
  8.         String text = "";
  9.  
  10.         while (true) {
  11.             input = scanner.nextLine();
  12.  
  13.             if ("stop".equals(input)) {
  14.                 break;
  15.             }
  16.  
  17.             char symbol = input.charAt(0);
  18.             text = text + symbol;
  19.         }
  20.  
  21.         System.out.println(text);
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment