打字猴:1.7004556e+09
1700455600
1700455601 //要有好身材
1700455602
1700455603 public void niceFigure();
1700455604
1700455605 }
1700455606
1700455607 public interface IGreatTemperamentGirl{
1700455608
1700455609 //要有气质
1700455610
1700455611 public void greatTemperament();
1700455612
1700455613 }
1700455614
1700455615 按照脸蛋、身材、气质都具备才算美女,实现类实现两个接口,如代码清单4-7所示。
1700455616
1700455617 代码清单4-7 最标准的美女
1700455618
1700455619 public class PettyGirl implements IGoodBodyGirl,IGreatTemperamentGirl{
1700455620
1700455621 private String name;
1700455622
1700455623 //美女都有名字
1700455624
1700455625 public PettyGirl(String_name){
1700455626
1700455627 this.name=_name;
1700455628
1700455629 }
1700455630
1700455631 //脸蛋漂亮
1700455632
1700455633 public void goodLooking(){
1700455634
1700455635 System.out.println(this.name+”–脸蛋很漂亮!”);
1700455636
1700455637 }
1700455638
1700455639 //气质要好
1700455640
1700455641 public void greatTemperament(){
1700455642
1700455643 System.out.println(this.name+”–气质非常好!”);
1700455644
1700455645 }
1700455646
1700455647 //身材要好
1700455648
1700455649 public void niceFigure(){
[ 上一页 ]  [ :1.7004556e+09 ]  [ 下一页 ]