//This is other's answer:

public static int addDigits(int num) {

int result = Test.addNum(num);

while(result > 9){

result = Test.addNum(result);

}

```
return result;
}
```

//below is mine:

public static int addDigits(int num) {

int result = Test.addNum(num);

while(result > 9){

result = Test.addNum(result);

}

```
return result;
}
public static int addNum(int num){
int result = 0;
while(num != 0){
result += (num%10);
num /= 10;
}
return result;
}
```