public class Game {
public static void main(String[] args) {
Game game = new Game();
System.out.println(game.show());
}
}
class Game{
String name;
String types;
int size;//大小
int star;//星级
String introduction;
public Game(){//方法
this("率土之滨","沙盘类",12000,5,"是一款好玩的游戏");
}
public Game (String name,String types, int size,int star,String introduction){
this.name = name;
this.types = types;
this.size = size;
this.star = star;
this.introduction = introduction;
}
public String show() {
return "游戏名:"+name+"\n"+"游戏类型为:"+types+"\n"+"游戏大小:"+size+"\n"+"星级:"+star+"\n"+introduction;
}
}