修改项目目录

This commit is contained in:
2024-10-09 11:06:06 +08:00
parent 028ae17647
commit a3e84dc516
29 changed files with 457 additions and 17 deletions

View File

@@ -0,0 +1,36 @@
package chapter3.demo31;
public class Book {
private final int id; // 编号
private final String name; // 书名
private final double price; // 价格
private final int storage; // 库存
// 有参构造
public Book(int id, String name, double price, int storage) {
this.id = id;
this.name = name;
this.price = price;
this.storage = storage;
}
// 获取书号
public int getId() {
return id;
}
// 获取书名
public String getName() {
return name;
}
// 获取价格
public double getPrice() {
return price;
}
// 获取库存
public int getStorage() {
return storage;
}
}