Finding happy numbers
The repeated n == 0 conditions are not pretty. It would be better to turn that part into a nested condition to avoid the duplication. It will also help simplifying the two conditions on sum.

In addition, there is one more comparison with 0 of n: in the loop condition. That's unnecessary, because n will never become 0. Only if the input is 0, but then the current implementation will return true, which is wrong, since 0 is not a happy number. As such, the loop can be while (true) infinite loop, and your could replace the last return statement with throw new IllegalStateException("whaaaat? How did you get here? ") or similar.

The overall logic would be easier to follow if you separate the summing of the digits from the method exit control. You could add a helper function that returns the sum of the squares of digits. Based on that result you could decide to return a value or continue for another round.

You can replace n=n/10 with n /= 10.

The formatting is messy too. Try the auto reformat feature of your favorite IDE.