Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Lista {
- String[] li;
- int size, max, maxIni;
- public Lista(){
- li = new String[10];
- size = 0;
- max = maxIni = 10;
- }
- public void shuffle(){
- Integer[] bf = new Integer[size];
- String[] ret = new String[size];
- Random rand = new Random();
- int r=0;
- boolean bool;
- for ( int a=0; a<size; a++ ){
- bool = true;
- while ( bool ){
- bool = false;
- r = rand.nextInt(size);
- for ( int b=0; b<a; b++ )
- if( r==bf[b] ) bool = true;
- }
- bf[a] = r;
- ret[a] = (String) li[r];
- }
- li = ret;
- }
- // Mรกs metodos
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement