• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IO

 
Jade Davidson
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope someone can help me.
My Java textbook shows how to get input from the user and says that we should include a Java package called iopack. All the examples of user input in our book use this, and apparently it is a class that came with our book, but everyone in my class is having problems using it, so my teacher says we shouldn't use it.
Is there some other package I should be including to enable the user input? I am sorry if this is a stupid question; this is the only way they show us in the book.
 
Marilyn de Queiroz
Sheriff
Posts: 9066
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you trying to get the input from the user on the command line, or while the program is running? They are different procedures.

To get input from the command line, you don't need to import anything.

To get input while the program is running, you need to import java.io.* ;
 
Jade Davidson
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While the program is running. I want to prompt the user to enter their name and birthdate.
I am assuming that is while it is running, because it is after the main method starts.
 
Marilyn de Queiroz
Sheriff
Posts: 9066
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Of course, you probably don't want to just echo the input so you'll have to modify this code.

[This message has been edited by Marilyn deQueiroz (edited November 04, 2001).]
 
Peter Simard
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
//MyInput.java: Contain the methods for reading int, double, and string values from the
//keybord


(Marilyn added code tags)
[This message has been edited by Marilyn deQueiroz (edited November 05, 2001).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic