title: My Java Code keeps returning wrong values?
body: <pre><code>public class CirclePlus implements Relatable {
      public double radius = 0;
      final double PI = 3.14159;
  
  CirclePlus(){}
  
  public CirclePlus(double radius) {
      radius = radius;
  }
  
  public double getArea() {
      return PI * (radius * radius);
  }
  
  public double isLargerThan(Relatable other) {
      CirclePlus otherCirc = (CirclePlus)other;
      if (this.getArea() &lt; otherCirc.getArea())
          return -1;           
      else if (this.getArea() &gt; otherCirc.getArea())
          return 1;            
      else
          return 0;
  
  }
  </code></pre>
  
  <p>/// Main class below</p>
  
  <pre><code>    public static void main(String[] args) {
      CirclePlus c1 = new CirclePlus(50);
      CirclePlus c2 = new CirclePlus(0);
  
      if(c1.isLargerThan(c2) == 1) {
        System.out.println("c1 is bigger!");
    }
    else
        System.out.println("c1 has the same size as that of c2 or smaller than"
                + " c2!");
  
  }
  </code></pre>
  
  <p>Output is always: </p>
  
  <pre><code>"c1 has the same size as that of c2 or smaller than"
  </code></pre>
  
  <p>No matter what I change the radius of the 2 circles to.</p>
  
  <p>This is my code, it keeps returning 0 in the final else statement but even when the conditions are met in the if/else if statements, it ignores them and just goes to the bottom and returns 0;</p>
  
  <p>Can you help me to fix this? Also, just so I can learn more, can you explain why java is doing this?</p>
  
  <p>Just the help will be okay too, thanks so much!</p>