How to find whether a number is a power of 2 or not in Java?There can be many possible solutions to this problem, but probably the most efficient remains to be the one which uses bit-level manipulation wisely.We'll talk about only that solution here and since it involves bit-level manipulation of binary sequences, so should you require a refresh, first go through this article - 2's complement, 1'