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 that is not working.
2 - I have array players, and I need to call a function, for example, getsaldo (); of / each of the players that is in the array. How can I do this? Thanks for the help, I have a great job to deliver and I know very little about java.