+ 1

Stuck!!! Please help on List Generic( different type class) C#

Hello All, Can I get a tip on this issue i got? I am creating an bank app. So i got 3 class. bankinfo, checking and saving class. Checking and Saving class is inheritance to bankinfo. Everything was going well until I try to combine the 2 list, so i can withdraw,deposit and check balanced. I cant fine a way to combine them to one list and keep the method each class do. I am very bad at explaining, please let me know. Stuck for a while. Thanks,

16th Mar 2019, 3:33 PM
Chan Pham
Chan Pham - avatar
6 Answers
+ 1
Checking is a verb Saving is a verb Bank info is a noun How could a saving class be independ without the knowledge of bank info. Class BankInfo() { private balance void Saving (int money) { balance = balance + money } balance Checking() { return balance } Why should you make a generic list for checking and saving ?
16th Mar 2019, 8:27 PM
sneeze
sneeze - avatar
+ 1
A good way of gaining knowledge is use this things you learn in class. This is just not the right place in the design to do it. To learn more about generics and the places it can be used in please read this post. https://www.sololearn.com/Discuss/1724565/c-generics Keep asking, keep trying, keep coding
16th Mar 2019, 8:35 PM
sneeze
sneeze - avatar
+ 1
Didnt see any link it you posted one.
16th Mar 2019, 8:36 PM
Chan Pham
Chan Pham - avatar
+ 1
Cool thanks.
16th Mar 2019, 8:39 PM
Chan Pham
Chan Pham - avatar
0
Yeah I dont no why, since class was teaching that so I just used it .. but I just got it.. just make a list with bank info.
16th Mar 2019, 8:30 PM
Chan Pham
Chan Pham - avatar
0
oeps forgotten. It is in there now.
16th Mar 2019, 8:37 PM
sneeze
sneeze - avatar