Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2012
    Posts
    52
    Rep Power
    0

    Question help with the Scanner

    I am wondering how to use the scanner to just read a specific word in the line, so that I can say like "Add 100" and it will run the method add() with the parameter 100. Thanks in advance

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    7

    Default Re: help with the Scanner

    See the API for the String class...you can read a line using the Scanner and parse that line using the methods of this class
    String (Java Platform SE 6)

  3. #3
    Join Date
    Jun 2012
    Posts
    52
    Rep Power
    0

Similar Threads

  1. How to use Scanner ?
    By sandeep43 in forum New To Java
    Replies: 7
    Last Post: 08-10-2011, 01:29 PM
  2. Scanner to int?
    By N00Bie in forum New To Java
    Replies: 6
    Last Post: 02-12-2011, 12:14 AM
  3. Help With Scanner
    By jtmoney0511 in forum New To Java
    Replies: 10
    Last Post: 10-12-2009, 11:24 PM
  4. Need help with scanner.
    By mainy in forum New To Java
    Replies: 3
    Last Post: 07-28-2009, 02:11 PM
  5. need help with scanner
    By whiterex in forum New To Java
    Replies: 1
    Last Post: 04-22-2008, 01:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •