Account
Main Topics
Browse All TopicsI have this working Hiearchy bank program here, If I were to make the Account class abstract, and make credit and debit abstract methods in the Account class. What else would need to change throughout the coding of all of the classes to make it a work?
First code is a test class, the next 3 posts are the program itself.
Thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
> If all that the methods do is add and subtract then it would make more sense just to make those methods as concrete implementations in Account rather than duplicating the code in 2 classes.
It does make sense to make them abstract, the point of abstract is to force subclasses to implement the logic. The actual logic is actually irrelevant
Quite. Although, in the current case, it appears there will be no difference between the two implentations or the credit and debit methods. If the methods are going to do the same thing in all (or even just most) of the classes, it will be more common, in practice, to just have them as methods in the base class.
I do see all of your points about making the class and methods abstract or leaving them be, could be both redundant or useful. But part of what I was trying to do was understand how exactly abstract declarations worked altogether, further my knowledge in the language and you guys helped me do that. Much appreciated guys.
Business Accounts
Answer for Membership
by: Stryker1990Posted on 2009-11-03 at 07:34:42ID: 25729913
Test class is this..
Select allOpen in new window