Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Scanner object versus creating own System.in class methods

Status
Not open for further replies.

theundergod

IS-IT--Management
Feb 4, 2005
30
US
I am learning Java on my own at the moment and the author of the book I am using created his own class with input methods. He uses methods all based around a method called getChar() which calls the System.in.read() method. All other methods he created like the getInt() and getWord() call on the getChar()method and handle the characters appropriately to get the desired Int or String. Is there a benefit to defining your own like this rather than just using a Scanner object in each of your own defined input methods? I am wondering if he did this just illustrate how Java handled input to the students. Thanks for any info.

Jon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top