how to init an array with objects in java

Java
Player[] thePlayers = {
    new Player(0),
    new Player(1),
    new Player(2),
    new Player(3)
};
Source

Also in Java: