Few simple java questions...

Discussion in 'Mac Programming' started by noel4r, Apr 19, 2007.

  1. noel4r macrumors 6502a

    Joined:
    Jul 17, 2002
    Location:
    Los Angeles
    #1
    1. How do I read an input one character at a time?

    2. Let's say we have an int x = 3838139, how can I refer to the 5th digit (1)? Example, is the 5th digit greater than 5?

    3. How do I convert an integer to a int array? Example 145 becomes an array w/ elements 1, 4, 5.
     
  2. toddburch macrumors 6502a

    Joined:
    Dec 4, 2006
    Location:
    Katy, Texas
    #2
    2) Convert the integer to a string and use substring.
    3) Convert the integer to a string, then the string to an int array, by substringing one digit at a time.
     

Share This Page