When I find out when neg repped me like that, they are DEAD!
I was NOT spoonfeeding. That code was a copy/paste pretty much of their own code a few posts earlier.
I've reported the incident...
Type: Posts; User: javapenguin
When I find out when neg repped me like that, they are DEAD!
I was NOT spoonfeeding. That code was a copy/paste pretty much of their own code a few posts earlier.
I've reported the incident...
r.nextInt() will return some random number that is a valid integer. That's from -2^32 +1 to 2^32 -1 I think. However, you could keep it as it but do this
int k = Math.abs(r.nextInt()) % 10;
...
Array indexes aren't valid, unless your variable happens to be of type Object, then it could be I think, if you initialized it as such, for regular int type.
Try using a different variable than...
The Random's nextInt() could return negatives. However, this might work for you.
r.nextInt(Integer.MAX_VALUE)%10;
However, if that generated 1000 and then 100, it would both go to 0 with that...
Actually, you might possibly be able to use a for loop for that one, though the while should be kept as well.
for (int k = 1; k <=10; k++)
{
if ( n < 0.1k) count(k-1)++;
}
Arrays are a collection of similar, to an extent, an Object array could hold anything for instance, types.
It has int indexes and would, assuming it was already intiialized, and assuming you...