"Inheritance" is referred to with the phrase "is-a". In your example, you would say "savings account IS A account", and "checking account IS A account" (bad grammer aside).
you would not say "savings account IS A TestAccountClass". So, Lalit is correct. I think this is what you were trying to do - or even what you thought you were doing, but just put the wrong class after 'extends'.
I think you'll have a problem in your SavingsAccount constructor - i don't see where the variable a is defined (and, to be honest, it's a poor choice for a variable name. it doesn't tell me what it is supposed to be).
ok, but back to inheritance. Does your Account class work ok? i didn't look at that code very carefully, but assuming it does...
what does a SavingsAccount do differently than an Account? if the answer is nothing, all you have to do is write a constructor that calls the super() constructor, and you're done. by using the
word "extends", your sub class does EVERYTHING THE SUPERCLASS DOES (except the constructor thing). you don't even have to mirror ANY calls to ANY method. that's the beauty of inheritance (well, one of them).
when you get to your CheckingAccount, it too will derive from account. it may be that all you have to do it override the "withdrawal" method. in the sub class, the method will have the same signiature. then, put in some logic for the overdraft protection. if you pass your tests, call the super.withdraw() method.
hope that helps (more importantly, since i've had no
coffee yet, hope i didn't say anything wrong!!!
good luck!!!