Flipping bits

  • + 0 comments

    java 8

    public static long flippingBits(long n) { int a = (int) n; return Integer.toUnsignedLong(~a); }