```
public int getSum(int a, int b) {
if(a ==0 && b == 0) return 0;
if(a > 0 && b == 0) {
return a;
}
if(a == 0 && b > 0) {
return b;
}
int sum = 0;
while(a !=0) {
if(a < 0){
a++;
sum--;
}else {
a--;
sum++;
}
}
while(b !=0) {
if(b < 0){
b++;
sum--;
}else {
b--;
sum++;
}
}
return sum;
}
```