This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes User inputs Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply 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: 24056
    
  13


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: 24056
    
  13

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: 965

Free code


Please ignore post, I have no idea what I am talking about.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: User inputs