输入:
班级游乐场
{
得分、球数、接球数;
字符串玩家名称;
公共游乐场(字符串玩家名称,int分数,int捕获量)
{
this.score = 分数;
this.player_name =player_name;
this.catchs = 捕获;
}
公共游乐场(字符串玩家名称,int分数,int接球数,int球数)
{
this.score = 分数;
this.player_name =player_name;
this.balls = 球;
this.catchs = 捕获;
}
public static void main(String[] args)
{
游乐场player1 = new Playground("dhoni",100,3);
游乐场player2 = new Playground("jadeja",56,2,30);
player1.batting();
player2.allround();
}
公共无效击球()
{
System.out.println(玩家名 " " 分数 " " 捕获数);
}
public void allround()
{
System.out.println(player_name " " score " " balls " " catchs);
}
}
输出:

以上就是日常任务的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号