Page 2 of 2 FirstFirst 12
Results 21 to 24 of 24
  1. #21
    drucey is offline Member
    Join Date
    Oct 2010
    Posts
    24
    Rep Power
    0

    Default

    My only problem with that is that the file i have been going to has 3 values:

    12000
    45000
    16000

    When i print out the statement only the 12000 gets shown on screen.

  2. #22
    al_Marshy_1981 is offline Senior Member
    Join Date
    Feb 2010
    Location
    Waterford, Ireland
    Posts
    748
    Rep Power
    5

    Default

    you will need a while loop and implement some scanner methods namely

    .hasNext() and .next() and .useDelimiter()

  3. #23
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    hasNext() and next(), that's all. hasNext() is the condition that I ask you yo check in a previous post. ;)

  4. #24
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by al_Marshy_1981 View Post
    Eranga there is no java exception as you are thinking, he is just saying the program works but only prints the first line.

    But it's misguided right, the word "exception" ?

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Simple string add or subtract using scanner
    By weezer562 in forum New To Java
    Replies: 12
    Last Post: 10-21-2010, 09:23 PM
  2. scanner question
    By kira137 in forum New To Java
    Replies: 8
    Last Post: 10-12-2009, 04:09 PM
  3. Scanner Issues (User Input: Very Simple)
    By carlodelmundo in forum New To Java
    Replies: 8
    Last Post: 10-31-2008, 03:44 AM
  4. Replies: 2
    Last Post: 06-02-2008, 11:24 PM
  5. Scanner class question
    By Rgfirefly24 in forum New To Java
    Replies: 5
    Last Post: 04-25-2008, 01:41 AM

Posting Permissions

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