Abstraction is one of the feature of Object Oriented Programming, where you show only relevant details to the user and hide irrelevant details. Abstraction is used to hide internal details and show only functionalities. Abstracting something means to give names to things, so that the name captures the basic idea of what a function or a whole program does.
The program demonstrates the concept of polymorphism in C++ programming using inheritance and virtual functions.
Overall, this program demonstrates the use of polymorphism in C++ programming to allow for different implementations of the same methods in different classes, enabling more flexible and extensible object-oriented programming.
Note that the IB class is not used in this program but could be instantiated in a similar way as the HDFC class and its methods called through the b pointer to demonstrate further polymorphism.
#include<iostream> using namespace std; class BANK { public: virtual void debit_credit()=0; virtual void loan()=0; }; class HDFC:public BANK { public: void debit_credit() { cout<<"Hdfc Banking Debit Credit"<<endl; } void loan() { cout<<"HDFC Banking loan 12%"<<endl; } }; class IB:public BANK { public: void debit_credit() { cout<<"Indian Banking Debit Credit"<<endl; } void loan() { cout<<"Indian Banking loan 8%"<<endl; } }; int main() { BANK *b= new HDFC(); b->debit_credit(); b->loan(); return 0; }
Hdfc Banking Debit Credit HDFC Banking loan 12%To download raw file Click Here
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions