Method Overriding - Seriously confused :-(
Dear All,
I have two account classes say A and B. B extends A. I am trying to re-write a method in B that is also in A but I would like to expand on this method greatly. The problem is that my coursebooks tell me to do this:
Code:
public void credit(double money);
{
super.credit();
//and then expand on the method here
The credit method in A is written the same public void credit(double money);
When I try and compile the code - I get the error:
credit(double) in A cannot be applied to (). I then try and change the code to:
Code:
public void credit(double money);
{
super.credit(double money)
//and then expand on the method here
I then get the error message: .class expected.
All I can say is AAAAAAAH!
Any help would be gratefully received.
Cheers - FMJ.