title: JAVA program that checks if a triangle is scalene, isosceles, equilateral, or not a triangle
body: <p>I am trying to write java program to see if a triangle is scalene, isosceles, equilateral or not a triangle. With the integers I used it is supposed to be not a triangle (1, 1, 30). But I keep getting scalene and not a triangle together. Any help is appreciated! Thank you!</p>
  <pre><code>public class Tri {
  
      static void checkTriangle(int x, int y, int z) 
      { 
  
          // Check for equilateral triangle 
          if (x == y &amp;&amp; y == z ) 
              System.out.println(&quot;Equilateral Triangle&quot;); 
  
          // Check for isoceles triangle 
          else if (x == y || y == z || z == x ) 
              System.out.println(&quot;Isoceles Triangle&quot;); 
  
          // Check for scalene triangle
          else if (x != y || y!= z || z != x)
              System.out.println(&quot;Scalene Triangle&quot;);
          {
              // Check for not a triangle 
              if (x + y &lt; z || x + z &lt; y || y + z &gt; x) 
                  System.out.println(&quot;Not a triangle&quot;);
  
          }
      } 
  
      public static void main(String[] args) {
          { 
  
              int x = 1, y = 1, z = 30; 
  
              checkTriangle(x, y, z); 
          } 
      } 
  }
  </code></pre>