The idea is that numbers in quaternary system that is power of 4 will be like 10, 100, 1000 and such. Similar to binary case. And this can be extended to any radix.

```
public boolean isPowerOfFour(int num) {
return Integer.toString(num, 4).matches("10*");
}
```