1
insira o código aquiArrayList<Player> players = new ArrayList<Player>(); for(contador=0;contador<x;contador++){ Player p1 = new Player(); p1.setId(contador); p1.setSaldo(valorinteger = Integer.parseInt(parts[2])); players.add(p1); }
1- I need to create X players in this array, and each 1 will have a different balance. how can I do this since it’s not working.
2- I have the array players, and I need to call a function, for example, getsaldo(); from/each of the players in the array. How can I do this? I already appreciate the help, I have a great job to deliver and I know very little java.
Correct code. for(counter=0; counter<fixed value;counter++){ Player P1 = new Player(); P1.setId(counter); P1.setSaldo(valorinteger = Integer.parseint(Parts[2]); players.add(P1); }
– Programador com problema