public class BankAccount { private int accNum; // Private access private String name; // -- limit to ONLY inside private double balance; // the class "BankAccount" /* ==================================================== Constructor 1: initialize all 3 instance variables ==================================================== */ BankAccount(int a, String n, double amount) { accNum = a; name = n; balance = amount; } /* ==================================================== Default Constructor ==================================================== */ BankAccount( ) { accNum = -1; name = "Nobody"; balance = 0.0; } /* ============================================== convToString(): return a String containing information of BankAccount ============================================== */ public String convToString( ) { return( "Account number: " + this.accNum + ", Name: " + this.name + ", Balance: " + this.balance); } /* ============================================== deposit(amount): Add "amount" to balance ============================================== */ public void deposit( double amount ) { this.balance += amount; } /* ====================================================== withdraw(amount): Subtract "amount" from balance ====================================================== */ public void withdraw( double amount ) { if ( this.balance >= amount ) this.balance -= amount; // Subtract "amount" from balance } }