Advertisement
Guest User

Untitled

a guest
Nov 28th, 2015
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1.  
  2. public class Accounts {
  3.  
  4. public static void main(String[] args) {
  5. // Code in Account.Java should not be touched!
  6. // write your code here
  7.  
  8. Account A = new Account("A", 100.0);
  9. Account B = new Account("B", 0.0);
  10. Account C = new Account("C", 0.0);
  11. transfer(A, B, 50);
  12. transfer(B,C,25);
  13.  
  14.  
  15. }
  16.  
  17.  
  18. public static void transfer(Account from, Account to, double howMuch)
  19.  
  20. {
  21. from = from-howMuch;
  22. to = to+howMuch;
  23.  
  24. }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement