Id is assigned for each player and getId mothod is implemented to return id of the player.