title: assert not working the way i thought in java
body: <p>I am new to java.. so maybe thats why I am not getting the keyword right?</p>
  
  <p>So.. I wrote a quick class from that bank customer example.. and one of the method is withdraw.</p>
  
  <pre><code>public void withdraw(double d){
          double diff = balance - d;
          assert (diff&gt;=0 ) :" Insufficient funds!";
          balance = diff;
      }
  </code></pre>
  
  <p>So what I was intending was if the withdraw abount is greater than the balance.. then throw up an error... (which i think should be more like an exception .... but lets say i want to check this by assertion)...</p>
  
  <p>But it doesnt do anything.. even though when diff is less than zero..</p>
  
  <p>the code compiles fine.. whereas I was expecting it to throw up an error.</p>
  
  <p>What am i doing wrong</p>