NumberFormat nf =NumberFormat.getCurrencyInstance(Locale.CANADA);
System.out.println("Checking account balance = $"+String.format("%.2f", this.balance));
How to connect this two?
As the NumberFormat will be the responsible for formatting your balance, you don't need to format it using String.format
.
So you could use something like that:
System.out.println("Checking account balance = " + nf.format(balance));
Just to highlight, I've removed also the $
from the text, as the NumberFormat will handle that for you.