Search:

Type: Posts; User: matinm90

Search: Search took 0.12 seconds.

  1. Replies
    12
    Views
    5,527

    Re: generate unique 9 digit number bug

    Oh okay that makes sense thank you, I didnt realize that the random class did that. I thought nextInt(9) created number from 0 to 9, but i guess not. Thank you!
  2. Replies
    12
    Views
    5,527

    Re: generate unique 9 digit number bug

    Oh so then if I took that string and converted it back into a Integer, would it retain the whole value? or would some numbers get lost? hope that made sense.
  3. Re: How to find indexes of ALL occurrences of object in ArrayList

    Sorry I am new to posting code on a forum, I will fix it.
  4. Replies
    12
    Views
    5,527

    Re: generate unique 9 digit number bug

    Well I dont see any with zeros in the beggining, does that mean java ignores leading zeros and deletes them?

    540326781 9
    457230168 9
    51328764 8
    250871643 9
    370418652 9
    206357814 9
    157204638...
  5. Re: How to find indexes of ALL occurrences of object in ArrayList

    Okay so the collections class doesnt have a method for this, you can however iterate through the whole list and check each element and store each index of the occurrence in a separate arraylist. Even...
  6. Replies
    5
    Views
    1,293

    Re: HELP ME TO SOLVE THIS JAVA FOR LOOP PROGRAM

    I am not sure what your code is but one way of writing this could be:


    int i = 0;
    while(true)
    {
    take the power of i to itselft (ie. i^i)
    then add it to some instance variable.

    after that...
  7. Replies
    12
    Views
    5,527

    Re: generate unique 9 digit number bug

    Sorry for taking so long i posted the code on the original message.
  8. Replies
    12
    Views
    5,527

    generate unique 9 digit number bug

    Okay so I wrote a method that generates a random 9 digit number with each digit being unique, the problem i am having, is for some reason, there is a case where the method accidentally returns an 8...
Results 1 to 8 of 9