Advertisement
Guest User

Untitled

a guest
May 8th, 2011
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.26 KB | None | 0 0
  1.  
  2. public class Account {
  3.     private int balance;
  4.  
  5.     public Account() {
  6.         this.balance = 0;
  7.     }
  8.  
  9.     public void transfer(int amount) {
  10.         this.balance += amount;
  11.     }
  12.  
  13.     @Override
  14.     public String toString() {
  15.         return "Account (balance: " + balance + ")";
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement