title: applying casting in the return of a function in java?
body: <p>I just wrote this simple methode that must return a double value. It's a function to withdraw money from the bank account. The function must let the user get the money only if he entries a value smaller than his the amount of money he has in his account.
  There is a condition where, if he is a special user, he can take the money even if he tries a value = balance+1000.</p>
  
  <p>As I'm a beginner to java, I'm not yet familiar with this thing of types (I'm a php programmer, so I never really had to worry about this, but I'm getting troubles to make this code work, because I'm returning a double, if it's ok, but a false, if it's not, and I can't do this in java.. This is my methode.. (the variables 'balance' and 'special' belongs to my class).</p>
  
  <pre><code>public double getMoney (double value) {
      if (value &lt;= balance) {
          balance = balance - value;
      } else {
          if (special == true &amp;&amp; value &lt; (balance+1000)) {
              return balance-value;
          } else {
              return false;
          }
      }
  }
  </code></pre>
  
  <p>I know it's a noob question, but I just started studying java and I was used to code using PHP, where I don't need to worry about the type of my variables, so I was wondering if you could give me some advices.
  Thanks</p>