I have the following code:
public static void main(String[] args) { Player players[] = new Player[2]; Scanner kb = new Scanner(System.in); System.out.p
Its because of the static field. Statics are used across object instances. They are stored at class level.
Below code would work:
class Player { String name; public Player(String playerName) { name = playerName; } public String getName() { return name; } }