Search:

Type: Posts; User: javapenguin

Search: Search took 0.07 seconds.

  1. Replies
    47
    Views
    4,828

    Re: Guys, really need your help

    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...
  2. Replies
    47
    Views
    4,828

    Re: Guys, really need your help

    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;
    ...
  3. Replies
    47
    Views
    4,828

    Re: Guys, really need your help

    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...
  4. Replies
    47
    Views
    4,828

    Re: Guys, really need your help

    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...
  5. Replies
    47
    Views
    4,828

    Re: Guys, really need your help

    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)++;


    }
  6. Replies
    47
    Views
    4,828

    Re: Guys, really need your help

    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...
Results 1 to 6 of 6