difference between encapsulation and abstraction concepts [duplicate]
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Abstraction VS Information Hiding VS Encapsulation Can somebody explain to me the main differences between the principles of encapsulation and abstraction in objected-oriented programming (if possible with examples). 回答1: Sample: // NO ABSTRACTION, NO ENCAPSULATION const int catLegs = 4; const int spiderLegs = 8; Leg[] catLegs; Leg[] spiderLegs; void MakeCatRun(Distance b) { for (int i=0; i<catLegs; ++i) catLegs