Few simple java questions...

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

  1. noel4r macrumors 6502a

    Jul 17, 2002
    Los Angeles
    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

    Dec 4, 2006
    Katy, Texas
    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