title: 1-line IF statements in java
body: <p>Is it possible to have IF statements without braces in Java, e.g:</p>
  
  <pre><code>if (x == y)
    z = x * y;
  else
    z = y - x;
  </code></pre>
  
  <p>It's possible in PHP, and I'm not sure if I'm doing something wrong.</p>
  
  <p><strong>Clarification:</strong> Here's my actual code that i'm using:</p>
  
  <pre><code>if (other instanceof Square)
      Square realOther = (Square) other;
  else
      Rectangle realOther = (Rectangle) other;
  </code></pre>
  
  <p>But i got errors like "Syntax token on realOther , delete this token" and "realOther cannot be resolved" among others.</p>
  
  <p>What am I doing wrong?</p>