Here is code that is part of my program. I'm concerned of the constructor override warning with addTotalPerimeter. All other parts of the program that are not important have been left out. What can I do to fix the constructor override?
public Triangle(int side_a,int side_b,int side_c){
if(isValid() == true)
{
this.side_a = side_a;
this.side_b = side_b;
this.side_c = side_c;
accumulator = addTotalPerim();
}
else
{
this.side_a = 1;
this.side_b = 1;
this.side_c = 1;
}
counter++;
}
private boolean isValid(){
int x = 6;
int y = 5;
if(side_a > 0 && side_b > 0 && side_c > 0){
y = 1;
}
if((side_a + side_b > side_c) && (side_a + side_c > side_b) && (side_b + side_c > side_a)){
x = 1;
}
if(x == y)
return true;
else
return false;
}
public int addTotalPerim(){
accumulator += calcPerim();
return accumulator += calcPerim();
}