Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Input with System.in  RSS feed

 
Gary Bryan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been making a "love test" program, but I need something that lets the user input 2 names (one at a time). I have tried something like this:
String name1 = System.in.something();
String name2 = System.in.something();
but I've read about InputStreams, DataInput and stuff like that, so it can't be that simple. I have looked at the Sun tutorial on Standard In, Out and Error, but the bit for In is still under construction.
Please help, I've tried 2 newsgroups and another message board
------------------
--
Gary Bryan
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can read this using any of the Objects that use InputStream. One example is

You can add this to any class or have a special class of your own and call it from there.

[This message has been edited by Carl Trusiak (edited September 17, 2000).]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!