Guest User

Untitled

a guest
Jan 17th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Exam12Practice {
  4.  
  5. public static void main(String[] args)
  6. {
  7. Scanner input=new Scanner(System.in);
  8. String words="";
  9. System.out.println("enter a word");
  10. while(input.hasNext())
  11. {
  12. words = words.concat(input.next());
  13. }
  14.  
  15. System.out.println(words);
  16. }
  17. }
  18.  
  19. Type in your words
  20. Press Enter
  21. Press CTRL-Z (^D on *nix systems)
Add Comment
Please, Sign In to add comment