```
public boolean isHappy(int n) {
int result=n;
boolean isOne = false;
for(int i=0;i<10;i++){
result = splitDigitSum(result);
if(result==1){
isOne = true;
break;
}
}
return isOne;
}
public int splitDigitSum(int num){
int sum = 0;
int temp = num;
while(temp>0){
int digit = temp%10;
temp /=10;
sum+=digit*digit;
}
return sum;
}
```