aspose file tools*
The moose likes Beginning Java and the fly likes User inputs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "User inputs" Watch "User inputs" New topic
Author

User inputs

Jools Birch
Greenhorn

Joined: Nov 01, 2003
Posts: 6
I'm wondering how you would go about making a program that prints out a users input.
Could I have code for it?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34


But of course, this isn't what you're really after. Want to be more specific?


[Jess in Action][AskingGoodQuestions]
Jools Birch
Greenhorn

Joined: Nov 01, 2003
Posts: 6
Like this
Prompt user to enter a text "Enter something"
Once the user presses Enter,
whatever the user has inputted is displayed.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Not to give it all away for free...
Prompt by printing to System.out, of course. Read a line by wrapping System.in in an InputStreamReader and a BufferedReader in turn, then calling BufferedReader.readLine(). Then print the result to System.out.
Jools Birch
Greenhorn

Joined: Nov 01, 2003
Posts: 6
Why not "give away for free", it's not that much of a program is it?
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 986

Free code


Please ignore post, I have no idea what I am talking about.
 
jQuery in Action, 2nd edition
 
subject: User inputs