Before revision: Example: Bank Balance Class Retrieved from Java Coffee Break Q&A URL public class bank_balance { public String owner; private int balance; public bank_balance( String name, int dollars ) { owner = name; if (dollars >= 0) balance = dollars; else dollars =0; } public int getBalance() { return balance; } public void setBalance(int dollars) { if (dollars >= 0) balance = dollars; else dollars = 0; } } Here, the imperative variable balance is defined as a private int.
After revision: Example: Bank Balance Class Retrieved from Java Coffee Break Q&A public class bank_balance { public String owner; private int balance; public bank_balance( String name, int dollars ) { owner = name; if (dollars >= 0) balance = dollars; else dollars =0; } public int getBalance() { return balance; } public void setBalance(int dollars) { if (dollars >= 0) balance = dollars; else dollars = 0; } } Here, the imperative variable balance is defined as a private int.