1700456578
1700456579
private String scope;
1700456580
1700456581
private String author;
1700456582
1700456583
private int price;
1700456584
1700456585
public ComputerBook(String_name,int_price,String_author,String_scope){
1700456586
1700456587
this.name=_name;
1700456588
1700456589
this.price=_price;
1700456590
1700456591
this.author=_author;
1700456592
1700456593
this.scope=_scope;
1700456594
1700456595
}
1700456596
1700456597
public String getScope(){
1700456598
1700456599
return this.scope;
1700456600
1700456601
}
1700456602
1700456603
public String getAuthor(){
1700456604
1700456605
return this.author;
1700456606
1700456607
}
1700456608
1700456609
public String getName(){
1700456610
1700456611
return this.name;
1700456612
1700456613
}
1700456614
1700456615
public int getPrice(){
1700456616
1700456617
return this.price;
1700456618
1700456619
}
1700456620
1700456621
}
1700456622
1700456623
这也很简单,实现IComputerBook就可以,而BookStore类没有做任何的修改,只是在static静态模块中增加一条数据,如代码清单6-10所示。
1700456624
1700456625
代码清单6-10 书店销售计算机书籍
1700456626
1700456627
public class BookStore{
[
上一页 ]
[ :1.700456578e+09 ]
[
下一页 ]