In C # there is the function numeros.GetRange(0, quant);
I would like to know which function is equivalent to numeros.GetRange(0, quant);
of C # in Java
In C # there is the function numeros.GetRange(0, quant);
I would like to know which function is equivalent to numeros.GetRange(0, quant);
of C # in Java
To pick up a piece from one list and put it in another, you can use subList()
.
You should pass as the parameter the initial index (it will be included in the new list) and the end (it will not be included in the new list);
Eg:
ArrayList<Integer> novaLista = numeros.subList(0, indexFinal);