day06--面向对象的案例
This commit is contained in:
@@ -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 + '\'' +
|
||||
'}');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user