Both abstraction and encapsulation solve same problem of complexity in different dimensions. Encapsulation exposes only the required details of an object to the caller by forbidding access to certain members, whereas an abstraction not only hides the implementation details, but also provides a basis for your application to grow and change over a period of time. For example, if you abstract out the make and model of a vehicle as class attributes as opposed to as individual classes like Toyota, ToyotaCamry, ToyotaCorolla, etc, you can easily incorporate new types of cars at runtime by creating a new car object with the relevant make and model as arguments as opposed to having to declare a new set of classes.
2 comments:
Thanks for publishing this blog, really awesome. Its help me to clarify my doubts well.
C C++ Training in Chennai
c c++ course fees in chennai
C++ Training
C Language Training
C++ programming course
C C++ Training in Anna Nagar
JMeter Training in Chennai
javascript training in chennai
This is really worth reading. I really enjoyed the reading experiencethank you very much.
C and C++ Training Institute in chennai | C and C++ Training Institute in anna nagar | C and C++ Training Institute in omr | C and C++ Training Institute in porur | C and C++ Training Institute in tambaram | C and C++ Training Institute in velachery
Post a Comment