package com.hello.test; import java.util.Scanner; public class TestGame { public static void main(String[] args) { Player p = new Player() ; //实例化玩家对象 Game g = new Game(p) ;//实例化游戏对象 g.startGame();//调用方法 } } //游戏类 class Game { private Player p ; //设置…