java - How to Initialize a random number generator within an array to use for a bubble sort -


so coding class, asked create bubble sort method take array generate random numbers array, , sort them via bubble. cant seem array initialize. problem occurs within loop. please? bubble works fine when use pre-initialized numbers. ignore print statements.

random int array method(failure)

on line 28, don't declare type int. it's been initialized when array created. use randomnumbers[k] = (int)(math.random()*10);

also, used randomnumbers instead of array reason. don't use array capital letter. class name, not variable. (worse yet, it's class exists already.)


Comments

Popular posts from this blog

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

wordpress - (T_ENDFOREACH) php error -

Using django-mptt to get only the categories that have items -