Question: This method will be passed an integer and return the String “perfect”, “deficient”, or “abundant”.
A perfect number is one that is equal to the sum of its factor excluding itself.
A number is considered deficient if the sum of its factors excluding itself is less than the number.
A number is abundant if the sum of its factors excluding itself is greater than the number. 
For example, classify(6) ”perfect”. classify(12) ”abundant”
I pretty much already wrote the code, except it will only print "abundant. Where did I mess up?

```
public static boolean isFactor(int a, int b){
    if(b%a==0)
        return true;
    return false;
}
public static String classify(int n){
    int sum=0;
    for(int i=1; i<n; i++){
        if(isFactor(i,n));
        sum=sum+i;
        }
    if(sum==n)
        return "perfect";
    else if(sum<n)
        return "deficient";
    else return "abundant";
}

```

Answer: 
The sum value is not calculated correctly because you have semicolon after if statement.

Remove semicolon after your if statement

```
 for(int i=1; i<n; i++){
        if(isFactor(i,n))
            sum=sum+i;
 }

```
You have a semi-colon after if(isFactor(i,n)), so it's an if with an empty block, and sum=sum+i is always executed.