i have to write a method called bucketSort that accepts an array andsorts it. Does anyone know how to do this.Alsoif i have something likefor{for{if{for{if(If this if statement is true how i can make itreturn to the original for statement at the top and skip everythingelse.
To sort an array, look into the Comparator interface.Second question, put a label on the for loop that youwant to continue and name the label in your continue.Example :outer :for{for{if{for{if ( true )continue outer;...
call a method in the outer for loop and put the rest of the loops inthat method.then you just return from the new method if the inner if statementevaluates trueso:for{dooloop(...)void dooloop(...){for{if{for{ifreturn}
This sounds like homework. Hence, it should be in your notes and/orbook. Did you try Google? Incidentally, this sort is also called aradix sort.