Project 2
Explanation:
Encapsulation: The program uses encapsulation to hide the implementation details of classes and expose only necessary functionalities through public methods. For example, the RBI class encapsulates Customer and Account objects, and the derived classes like SBI and ICICI encapsulate their specific functionality while inheriting from the base class.
Inheritance: The program demonstrates inheritance by creating derived classes SBI and ICICI that inherit from the RBI base class. The derived classes inherit common functionalities and properties from the base class, and they can also override specific methods to provide their own implementations.
Polymorphism: Polymorphism is demonstrated through method overriding. The getInterestRate() and getWithdrawalLimit() methods are overridden in the derived classes to provide bank-specific interest rates and withdrawal limits.
Abstraction: Abstraction is achieved by creating abstract concepts like Customer, Account, and RBI classes, which represent real-world entities. The RBI class, being an abstract base class, defines the interface for common banking functionality.
Composition: Composition is used to create a "has-a" relationship between the RBI class and Customer and Account classes. The RBI class contains objects of Customer and Account classes to represent the relationship between them.