1: //LocalVariableDemoProgram.java 2: 3: /** 4: * A toy program to illustrate how local variables behave. 5: */ 6: public class LocalVariablesDemoProgram 7: { 8: public static void main(String[] args) 9: { 10: BankAccount myAccount = new BankAccount(); 11: myAccount.amount = 100.00; 12: myAccount.rate = 5; 13: double newAmount = 800.00; 14: myAccount.showNewBalance(); 15: System.out.println("I wish my new amount were $" + newAmount); 16: } 17: }