title: BankAccount java program not showing output
body: <p>I made this program and i don`t understand why is not showing anything , if someone can give me an advice or any hint about it . I would really appreciate it.</p>
  
  <p><strong>First part of the text</strong> <a href="https://i.imgur.com/4yNLefc.jpg" rel="nofollow noreferrer">http://i.imgur.com/4yNLefc.jpg</a> </p>
  
  <p><strong>Second part</strong> <a href="https://i.imgur.com/nq9FAGs.jpg" rel="nofollow noreferrer">http://i.imgur.com/nq9FAGs.jpg</a></p>
  
  <pre><code>import java.util.Calendar;
  
  abstract class BankAccount{
      private double balance=0;
      private String owner;
      private int id;
      private int idCurrentAccount=1;
  
      public BankAccount(String owner,double balance){
          this.owner=owner;
          this.id=idCurrentAccount++;
          this.balance=balance;    
      }
  
      public void deposit(double sum){
          this.balance=this.balance+sum;
          System.out.println("You just added "+sum+" in your account.You have know: "+balance);
      }
  
      public void withdraw(double sum){
          if(sum&gt;balance) 
              System.out.println("Sorry.Not enough money to withdraw!");
          else{
              System.out.println("You just withdrawed "+sum+" from "+balance+".Have a nice day!");
              balance=balance-sum;
          }
      }
  
      public double getBalance(){
          return balance;
      }
  
      public String getOwner(){
          return owner;
      }
  
      public int getId(){
          return id;
      }
  
      @Override
      public String toString(){
          return owner+balance+id+idCurrentAccount;
      }
  
      public abstract void endOfMonth();
  }
  
  class SavingsAccount extends BankAccount{
      private double interestRate;
  
      public SavingsAccount(String owner,double balance,double interestRate){
          super(owner,balance);     
          this.interestRate=interestRate;
      }
  
      public void applyInterest(){
          deposit(getBalance()*interestRate);   
      }
  
      @Override
      public String toString(){
          return super.toString()+interestRate;
      }
  
      @Override
      public void endOfMonth(){
          Calendar cal=Calendar.getInstance();
          int currentMonth=cal.get(Calendar.MONTH);
          cal.add(Calendar.DAY_OF_YEAR,1);
          int nextDayMonth=cal.get(Calendar.MONTH);
          if(currentMonth!=nextDayMonth){
              applyInterest();    
          } 
      }
  }
  
  class CurrentAccount extends BankAccount{
      private int transactionNo=0;
      final int FREE_TRANSACTIONS=5;
      double TRANSACTION_COST;
  
      public CurrentAccount(String owner, double balance, int transNr, double transCost){
          super(owner,balance);
          this.transactionNo=transNr;
          this.TRANSACTION_COST=transCost;
      }
  
      public void dischargeExpenses() {
          if(transactionNo&gt;FREE_TRANSACTIONS)
              withdraw(getBalance()-TRANSACTION_COST);
      }
  
      @Override
      public String toString(){
          return super.toString()+transactionNo+TRANSACTION_COST; 
      }
  
      @Override
      public void deposit(double sum){
          super.deposit(sum);
          transactionNo++;
      }
  
      @Override
      public void withdraw(double sum){
          super.withdraw(sum);
          transactionNo++;
      }
  
      @Override
      public void endOfMonth(){
          Calendar cal=Calendar.getInstance();
          int currentMonth=cal.get(Calendar.MONTH);
          cal.add(Calendar.DAY_OF_YEAR,1);
          int nextDayMonth=cal.get(Calendar.MONTH);
          if(currentMonth!=nextDayMonth){
              dischargeExpenses();
              transactionNo=0;
          }   
      }
  }
  
  public class Llab12{
      public static void main(String[] args){
          SavingsAccount a = new SavingsAccount("Dan",1000,100);
          SavingsAccount b = new SavingsAccount("Alex",10000,1000);
          CurrentAccount c = new CurrentAccount("Dan",200000,10,100);
          CurrentAccount d = new CurrentAccount("Alex",200000,33,100);
          a.toString(); //Not showing output
          b.toString(); //Not showing output
          c.toString(); //Not showing output
          d.toString(); //Not showing output
          c.deposit(300);
          d.deposit(900);
          c.getBalance(); //Not showing output
          d.getBalance(); //Not showing output
          c.deposit(3007);
          d.withdraw(9);
          c.getBalance(); //Not showing output
          d.getBalance(); //Not showing output
          c.endOfMonth(); //Not showing output
          d.endOfMonth(); //Not showing output
          c.toString(); //Not showing output
          d.toString(); //Not showing output      
      }       
  }
  </code></pre>