title: How to compare three boolean values
body: <p>Compare three boolean values and display the first one that is true.</p>
  
  <p>Hey guys, I am trying to write a program that compares three boolean values and displays the first true one. I am comparing three words for their length, and it will display the longest. The error that I am getting is that my else tags aren't working. Take a look at the code.</p>
  
  <pre><code>//Check which word is bigger
      if (len1 &gt; len2)
          word1bt2 = true;
  
      if (len2 &gt; len3)
          word2bt3 = true;
  
      if (len1 &gt; len3)
          word1bt3 = true;
  
      //Check which word is the longest
      if (word1bt2 == true &amp;&amp; word1bt3 == true);
          System.out.println(wor1);
          else if (word2bt3 == true);
          System.out.println(wor2);
          else System.out.println(wor3);
  </code></pre>
  
  <p>I have set boolean values for word1bt2, word2bt3 and word1bt3. In eclipse, I am getting a syntax error under the elses in my code above. Any help would be great!</p>