Concatenando arrays

2 respostas
P

ola

existe alguma classe que concatene arrays?

minha solução atual é isso aqui, mas não acho nem um pouco elegante, tem alguma api que faça isso?

public byte[] adicBytes(byte[] variavel, byte[] incremental) { byte[] retorno = new byte[variavel.length+incremental.length]; for (int i=0; i<retorno.length; i++) { if (i<variavel.length) retorno[i] = variavel[i]; else retorno[i] = incremental[i-variavel.length]; } return retorno; }

valeu desde já…

2 Respostas

F
List<SuaClasse> listArray = new ArrayList<SuaClasse>();

listArray.addAll(listaVelha);
listArray.addAll(listaVelha1);
listArray.addAll(listaVelha2);
listArray.addAll(listaVelha3);
P

valeu fabiozoroastro.

Criado 3 de junho de 2006
Ultima resposta 5 de jun. de 2006
Respostas 2
Participantes 2