public boolean isPowerOfFour(int num) {
return num > 0 && (num&(num1)) == 0 && (num & 0x55555555) != 0;
//0x55555555 is to get rid of those power of 2 but not power of 4
//so that the single 1 bit always appears at the odd position
}
Java 1line (cheating for the purpose of not using loops)

I got another 1 line solution, basically just change number to quaternary and then check if it starts with "10".
public boolean isPowerOfFour(int num) { return Integer.toString(num, 4).matches("10*"); }
https://leetcode.com/discuss/97967/java1lineofcodeandcanbeextendedtoanyradixsolution

Good solution without good explanation,it's easy to find that power of 4 numbers have those 3 common features.First,greater than 0.Second,only have one '1' bit in their binary notation,so we use x&(x1) to delete the lowest '1',and if then it becomes 0,it prove that there is only one '1' bit.Third,the only '1' bit should be locate at the odd location,for example,16.It's binary is 00010000.So we can use '0x55555555' to check if the '1' bit is in the right place.With this thought we can code it out easily!

I think (num > 0) is a redundant check and can be safely removed. It is implicitly implied in the last two checks. Here is the reason:
 if num == 0, the last test would fail;
 if num < 0 and num != 0x80000000, there are alway at least two '1's in its binary representation (one of them is the MSB). It would fail the test (num & (num  1)).
 if num < 0 and num == 0x80000000, it would simply fail the last test again.
All the results from the above three conditions suggest the last two checks successfully cover the case where num <= 0. Therefore the first test (num > 0) is not necessary and thus can be removed. The code is slightly microoptimized by (one?) instruction.