day06--面向对象的案例

This commit is contained in:
xx
2026-09-21 13:49:19 +08:00
parent 7add132b4b
commit aae9ed021b
2 changed files with 83 additions and 0 deletions
+56
View File
@@ -15,4 +15,60 @@ package com.inmind.javabean04;
*/
public class Book {
private String bid;
private String bName;
private double price;
private String date;
public Book() {
}
public Book(String bid, String bName, double price, String date) {
this.bid = bid;
this.bName = bName;
this.price = price;
this.date = date;
}
public String getBid() {
return bid;
}
public void setBid(String bid) {
this.bid = bid;
}
public String getbName() {
return bName;
}
public void setbName(String bName) {
this.bName = bName;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public void showBook() {
System.out.println("图书信息{" +
"图书编号='" + bid + '\'' +
", 书名='" + bName + '\'' +
", 价格=" + price +
", 日期='" + date + '\'' +
'}');
}
}