1700455433
1700455434
代码清单4-1 美女类
1700455435
1700455436
public interface IPettyGirl{
1700455437
1700455438
//要有姣好的面孔
1700455439
1700455440
public void goodLooking();
1700455441
1700455442
//要有好身材
1700455443
1700455444
public void niceFigure();
1700455445
1700455446
//要有气质
1700455447
1700455448
public void greatTemperament();
1700455449
1700455450
}
1700455451
1700455452
美女的标准定义完毕,具体的美女实现类如代码清单4-2所示。
1700455453
1700455454
代码清单4-2 美女实现类
1700455455
1700455456
public class PettyGirl implements IPettyGirl{
1700455457
1700455458
private String name;
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
}
[
上一页 ]
[ :1.700455433e+09 ]
[
下一页 ]