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!
Type: Posts; User: matinm90
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!
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.
Sorry I am new to posting code on a forum, I will fix it.
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...
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...
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...
Sorry for taking so long i posted the code on the original message.
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...