Account balance incorrectly calculated
<p>The result of running the below code is:</p>

<pre class="lang-none prettyprint-override"><code>Final account balance is: -97.0
</code></pre>

<p>But the answer should be 150.0, right? Where have I gone wrong?</p>

<pre><code>class Account
{
  double initBalance;

  Account(double initBalance)
  {
    initBalance=this.initBalance;
  }

  double getBalance()
  {
    return initBalance;
  }

  void deposit(double amt)
  {
    initBalance=initBalance + amt;
  }

  void withdraw(double amt)
  {
    initBalance=initBalance - amt;
  }

}


class TestAccount
{
  public static void main(String args[])
  {
    Account acct=new Account(100);
    acct.deposit(50);
    System.out.println("Final account balance is: " +acct.getBalance());
  }
}
</code></pre>
