title: Passing an interface in Parameters C#
body: <p><a href="https://i.stack.imgur.com/hDhCe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hDhCe.png" alt="image" /></a></p>
  <ul>
  <li>What is the Benefit of passing in Parameters?</li>
  <li>What can we achieve from this?</li>
  <li>What is the purpose of?</li>
  </ul>
  <hr />
  <pre><code>interface IBankAccount
  {
      void PayIn(decimal amount);
      bool Withdraw(decimal amount);
      decimal Balance { get; }
  }
  
  interface ITransferBankAccount : IBankAccount
  {
      bool TranferTo(IBankAccount destination, decimal amount);
  }
  
  class CurrentAccount : ITransferBankAccount
  {    
      public bool TranferTo(IBankAccount destination, decimal amount)
      {
          bool result;
          result = Withdraw(amount);
          if (result)
          {
              destination.PayIn(amount);
          }
          return result;
      }      
  
      public decimal Balance
      {
          get
          {
              throw new NotImplementedException();
          }
      }
  
      public void PayIn(decimal amount)
      {
          throw new NotImplementedException();
      }
  
      public bool Withdraw(decimal amount)
      {
          throw new NotImplementedException();
      }
  </code></pre>
  <p>Demo Code showing This technique
  Thanks in Advance</p>