Results 1 to 5 of 5
  1. #1
    GreenTea is offline Member
    Join Date
    Oct 2010
    Posts
    13
    Rep Power
    0

    Default String Tokenizer help

    I forgot my password and username to this site so I had to make a new one. Okay my code says Process Completed so apparently there isn't any errors, but then it only displays the data line and says Exception in thread

    We are supposed to get data from a separate text file and there is another 'string' before the numbers..there's two 'words' so I need to display the name..I'm not sure if I did it right
    Last edited by GreenTea; 10-30-2010 at 03:28 AM.

  2. #2
    joshdgreen's Avatar
    joshdgreen is offline Senior Member
    Join Date
    Oct 2010
    Location
    Colorado Springs, CO
    Posts
    212
    Rep Power
    5

    Default

    Works fine for me when I enter 2 strings followed by 11 numbers. I put in: "Josh is 1 2 3 4 5 6 7 8 9 10 11" and got:

    data line = Josh is 1 2 3 4 5 6 7 8 9 10 11

    Separated data line :
    Josh
    is
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    sum of numbers = 65
    Sincerely, Joshua Green
    Please REP if I help :)

  3. #3
    joshdgreen's Avatar
    joshdgreen is offline Senior Member
    Join Date
    Oct 2010
    Location
    Colorado Springs, CO
    Posts
    212
    Rep Power
    5

    Default

    The error is probably because you declare all of your numbers as integers and you are trying to use a double.
    Sincerely, Joshua Green
    Please REP if I help :)

  4. #4
    GreenTea is offline Member
    Join Date
    Oct 2010
    Posts
    13
    Rep Power
    0

    Default

    Okay I will try it. I am an idiot..I hope that is why

  5. #5
    GreenTea is offline Member
    Join Date
    Oct 2010
    Posts
    13
    Rep Power
    0

    Default

    Nevermind..figured out what I wanted to figure out
    Last edited by GreenTea; 10-30-2010 at 03:19 AM.

Similar Threads

  1. String Tokenizer
    By sumaih in forum Java Gaming
    Replies: 2
    Last Post: 08-21-2010, 03:23 PM
  2. String Tokenizer
    By hussainian in forum Advanced Java
    Replies: 1
    Last Post: 03-16-2010, 08:58 AM
  3. String Tokenizer
    By viperlasson in forum New To Java
    Replies: 1
    Last Post: 03-09-2010, 01:14 PM
  4. String Tokenizer
    By redasu in forum Advanced Java
    Replies: 4
    Last Post: 02-19-2010, 03:30 AM
  5. string tokenizer
    By twinytwo in forum New To Java
    Replies: 2
    Last Post: 03-26-2009, 02:10 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
  •