Java help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bachovchin
    New Member
    • Jan 2007
    • 1

    #1

    Java help

    Ok, I'm trying to read in data from a text file.

    In input.txt, I have the following line
    11 14 9 3 2 10 15

    How can I read in those 7 numbers and place them in arrays?

    Because some of the numbers are two digits,
    char user = (char)(in.read( )); does not work.

    Thanks.
  • Ganon11
    Recognized Expert Specialist
    • Oct 2006
    • 3651

    #2
    What method of input are you using?

    What version of Java are you programming in?

    Comment

    • horace1
      Recognized Expert Top Contributor
      • Nov 2006
      • 1510

      #3
      have a look at nextInt() in the Scanner class
      http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html

      Comment

      Working...