, r" d7 r( _' @* A [ Function Thar Use Referennces To Base(Super) Classes Must Be Able To Use Objects Of Derived(Sub) Classes Without Knowing It ] 2 c. {1 n6 x- c6 H$ y
. q% c3 _! U7 B$ M
- o2 |( R7 S1 G% r l% Q. C
Liskov替换法则 1 `0 e3 n4 L& y, W' `$ \* l % [5 m8 \' r4 `1 x& x 7 i% T1 I& R" J1.显而易见,Liskov替换法则(LSP)是根据我所熟知的"多态"而得出的。 & }2 L9 n4 v/ o ' f/ f: V: \1 ]& _# Y7 q+ g* i
2.例如: % o: [$ K2 q6 V8 t) `$ a+ N
' e* I* c) V% O4 f1 Y8 i