[Solved] Changing a variable name [closed]


You can’t have dynamic variable names in Java. What you can do is use a Map, to associate a key (the player’s name, for example), with a value (the player’s password, for example):

Map<String, String> passwordsByPlayer = new HashMap<>();
...
passwordsByPlayer.put(playerName, passwordField.getText());

2

solved Changing a variable name [closed]