Advertisement
therrontelford

Implicit call of toString()

Oct 1st, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. /*
  2. Therron Telford
  3. AP CS A
  4. October 14, 2017
  5. */
  6.  
  7. public class BankAccount {
  8.    
  9.     private double balance;
  10.     private double deposit;
  11.    
  12.     public void deposit(){
  13.        
  14.         double deposit = 100;
  15.        
  16.     }
  17.     public String toString(){
  18.         return "The balance  is " + (balance + deposit);
  19.     }
  20. }
  21.  
  22. // in the main of BankAccountTest
  23. // BankAccount mine = new BankAccount();
  24. // mine.deposit();
  25. // System.out.println(mine);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement