A line of credit that can have a negative balance, but when there's a balance, there's an interest charge each month.An interest earning account that accrues interest at the end of each month.Over time, needs change, and related account types are requested: It works great in the situation where there is only one bank account type. Create different types of accountsĪfter building this program, you get requests to add features to it. You'll also add features to the BankAccount class, taking advantage of the abstraction and encapsulation techniques you learned in the preceding tutorial. In this tutorial, you'll extend that application to make use of inheritance and polymorphism to add new features. Both the BankAccount and Transaction classes provide encapsulation of the components needed to describe those concepts in code. You could modify its implementation without affecting any of the code that used the BankAccount class. The BankAccount class provided an abstraction for the concept of a bank account. In the preceding tutorial, introduction to classes you saw both abstraction and encapsulation. Polymorphism Ability to implement inherited properties or methods in different ways across multiple abstractions.Inheritance Ability to create new abstractions based on existing abstractions.Encapsulation Hiding the internal state and functionality of an object and only allowing access through a public set of functions.Abstraction Modeling the relevant attributes and interactions of entities as classes to define an abstract representation of a system.The four basic principles of object-oriented programming are: C# is an object-oriented programming language.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |