1700441690
1700441691
public int strong(){
1700441692
1700441693
return 8;
1700441694
1700441695
}
1700441696
1700441697
}
1700441698
1700441699
class MotherImpl implements Mother{
1700441700
1700441701
//母亲的温柔指数是8
1700441702
1700441703
public int kind(){
1700441704
1700441705
return 8;
1700441706
1700441707
}
1700441708
1700441709
}
1700441710
1700441711
父亲强壮指数是8,母亲温柔指数也是8,门当户对,那他们生的儿子、女儿一定更优秀了,我们先来看儿子类,代码如下:
1700441712
1700441713
class Son extends FatherImpl implements Mother{
1700441714
1700441715
@Override
1700441716
1700441717
public int strong(){
1700441718
1700441719
//儿子比父亲强壮
1700441720
1700441721
return super.strong()+1;
1700441722
1700441723
}
1700441724
1700441725
@Override
1700441726
1700441727
public int kind(){
1700441728
1700441729
return new MotherSpecial().kind();
1700441730
1700441731
}
1700441732
1700441733
private class MotherSpecial extends MotherImpl{
1700441734
1700441735
public int kind(){
1700441736
1700441737
//儿子温柔指数降低了
1700441738
1700441739
return super.kind()-1;
[
上一页 ]
[ :1.70044169e+09 ]
[
下一页 ]