Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

User inputs

 
Jools Birch
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

But of course, this isn't what you're really after. Want to be more specific?
 
Jools Birch
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not "give away for free", it's not that much of a program is it?
 
William Barnes
Ranch Hand
Posts: 986
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Free code
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic