public class Solution {
public boolean isPowerOfFour(int num) {
return Integer.toBinaryString(num).matches("1(00)*");
}
}
Java oneline without loops by Regular Expression

@kimmylouie Any number that is a power of 4 will have 1 followed by even number of 0's
in it's binary representation.
Egs : 4  100
16  10000