Source of LocalVariablesDemoProgram.java


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