title: Is there a difference between multiple if statements and else if?
body: <p>If I write </p>
  
  <pre><code>int a = 1;
  int b = 2;
  
  if (a == b) {
  
  //Do something
  
  } else if (a &gt; b) {
  
  //Do something else
  
  } else if (a &lt; b) {
  
  //Do something else
  
  }
  </code></pre>
  
  <p>as opposed to:</p>
  
  <pre><code>if (a == b) {
  
  //Do something
  
  }
  if (a &gt; b) {
  
  //Do something else
  
  }
  if (a &lt; b) {
  
  //Do something else
  
  }
  </code></pre>
  
  <p>Is there a difference be it the way the compiler interprets the code or speed? I see no logical difference, but there surely must be a reason why an if else statement exists. It's just a single line break difference.</p>