Good day to all)) Explain that there is magic?)
public class Game { private static final String GAME_NAME = "XO"; private Player[] players; public String getGameName() { return GAME_NAME; } and there is a class
public class ConsoleView { private final Game game; public ConsoleView(final Game game) { this.game = game; } public void showGameName() { System.out.println(game.getGameName()); } } So, I do not understand what this field announcement is?
private final Game game; And I cannot call methods through Game , but only through game .