Galera, vc podem dar uma olhada nesse meu codigo. Estou apanhando para fazer uma collection de objetos. A minha saída sempre sai com o mesmo valor. Parece que está subestituindo o ultimo vamor em todos os registro. Vlw
public static void main(String[] args) {
ArrayList al = new ArrayList ();
int d = 0;
while (d<10) {
testeBean testebean = new testeBean();
testebean.setA(d);
testebean.setB("B"+"***"+"-d-"+d);
al.add(testebean);
System.out.println("Entrada "+testebean.getA());
d++;
}
Iterator it = al.iterator();
while (it.hasNext())
{
testeBean novoBean = (testeBean) it.next();
System.out.println("Saída "+novoBean.getA());
System.out.println("Saída "+novoBean.getB());
}
}
}
[color=darkred]Aprenda a usar as tags Code para seu código não aparecer sem identação[/color]