Use code tags.
If you can't use code tags don't just say the error is at line 5. Try to point out where the error is. What if the error was at line 100. Should we count 100 lines?
And the answer is this:
You wrote:
public SavingsAccount(double bal); //constructor
{
savingsBalance= b;
}
First of all "b" variable is not defined: savingsBalance= <strong>b</strong>
I believe you meant: savingsBalance= <strong>bal</strong> which is the argument of the constructor.
Also you should remove the ';' after the declaration of the constructor: public SavingsAccount(double bal) <strong>;</strong> //constructor
javaAddict
Nearly a Senior Poster
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448
Check the API for DecimalFormat.
The error is because "format" doesn't exist as field variable. It says it clearly:
"can't find symbol" Meaning "format" doesn't exist.
Maybe you meant to call it as a method:
num.format() but I am not sure until YOU check the API
javaAddict
Nearly a Senior Poster
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448
You can use whatever you want. Did you look at the API?
javaAddict
Nearly a Senior Poster
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448