public class A{
private int id;private String bookName;
public Book(int i) {
super();
this.id=i;
}
public Book(int id, String bookName, float price, String author,
int bookTypeId) {
super();
this.id = id;
this.bookName = bookName;
this.price = price;
this.author = author;
this.bookTypeId = bookTypeId;
}
public Book(String bookName, float price, String author, int bookTypeId) {
super();
this.bookName = bookName;
this.price = price;
this.author = author;
this.bookTypeId = bookTypeId;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getBookName() {
return bookName;
}
public void setBookName(String bookName) {
this.bookName = bookName;
}
public float getPrice() {
return price;
}
public void setPrice(float price) {
this.price = price;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public int getBookTypeId() {
return bookTypeId;
}
public void setBookTypeId(int bookTypeId) {
this.bookTypeId = bookTypeId;
}
@Override
public String toString() {// TODO Auto-generated method stub
return "[ ''+this.a+","+this.b"]"; //重写toString()让对象完全按照你所需要的格式输出来,并且输出的对象的具体属性内容,而不是对象的地址
}
}