📄 books.java
字号:
package com.sample.java.bookcar;
import java.util.List;
import java.util.ArrayList;
public class Books {
private String name;
private double price;
private String author;
public Books(){}
public Books(String name,double price,String author){
this.name=name;
this.price=price;
this.author=author;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public String toString(){
return "book name is "+name+", price is "+price+", author is "+author;
}
/**
* 创建book数据
*/
public List createBooks(){
List list = new ArrayList();
for(int i = 0;i<20;i++){
Books book = new Books("book"+i,23.6+i,"lois"+i);
list.add(book);
}
return list;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -