class Book{
private String name;
private int price;
private String author;
private int year;
public String getName() {
return name;
}
public int getPrice() {
return price;
}
public String getAuthor() {
return author;
}
public int getYear() {
return year;
}
public Book(String name,int price,String author,int year) {
this.name = name;
this.price = price;
this.author = author;
this.year = year;
}//有参构造
}
PTA习题 6-3 Book类的设计
最新推荐文章于 2024-04-19 16:54:44 发布