打字猴:1.700455459e+09
1700455459
1700455460 //美女都有名字
1700455461
1700455462 public PettyGirl(String_name){
1700455463
1700455464 this.name=_name;
1700455465
1700455466 }
1700455467
1700455468 //脸蛋漂亮
1700455469
1700455470 public void goodLooking(){
1700455471
1700455472 System.out.println(this.name+”–脸蛋很漂亮!”);
1700455473
1700455474 }
1700455475
1700455476 //气质要好
1700455477
1700455478 public void greatTemperament(){
1700455479
1700455480 System.out.println(this.name+”–气质非常好!”);
1700455481
1700455482 }
1700455483
1700455484 //身材要好
1700455485
1700455486 public void niceFigure(){
1700455487
1700455488 System.out.println(this.name+”–身材非常棒!”);
1700455489
1700455490 }
1700455491
1700455492 }
1700455493
1700455494 通过三个方法,把对美女的要求都定义出来了,按照这个标准,如花姑娘被排除在美女标准之外了。有美女,就有搜索美女的星探,其具体实现如代码清单4-3所示。
1700455495
1700455496 代码清单4-3 星探抽象类源代码
1700455497
1700455498 public abstract class AbstractSearcher{
1700455499
1700455500 protected IPettyGirl pettyGirl;
1700455501
1700455502 public AbstractSearcher(IPettyGirl_pettyGirl){
1700455503
1700455504 this.pettyGirl=_pettyGirl;
1700455505
1700455506 }
1700455507
1700455508 //搜索美女,列出美女信息
[ 上一页 ]  [ :1.700455459e+09 ]  [ 下一页 ]