Oct 27, 2015

Give me the real time example of abstraction in c#.

A "Person" is the Example of OOPS. Skin hides the Heart methods, Body methods,........ as we donot need to know the implementation. we just know the body parts are working or not 

PERSON -- CLASS PART -- 

OBJECT TASK -- method 

ABSTRACTION -- donot want to know how parts work 

ENCAPSULATION - gives protection to our body with our clothes

 inheritence -- blood travels and inherits from one part to another 

POLYMORPHISM -- Brain function


 Laptop consists of many things such as processor, motherboard, RAM, keyboard, LCD screen, wireless antenna, web camera, usb ports, battery, speakers etc. To use it, you don't need to know how internally LCD screens, keyboard, web camera, battery, wireless antenna, speaker's works. You just need to know how to operate the laptop by switching it on. Think about if you would have to call to the engineer who knows all internal details of the laptop before operating it. This would have highly expensive as well as not easy to use everywhere by everyone.

No comments:

Post a Comment