Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Exam12Practice {
- public static void main(String[] args)
- {
- Scanner input=new Scanner(System.in);
- String words="";
- System.out.println("enter a word");
- while(input.hasNext())
- {
- words = words.concat(input.next());
- }
- System.out.println(words);
- }
- }
- Type in your words
- Press Enter
- Press CTRL-Z (^D on *nix systems)
Add Comment
Please, Sign In to add comment