@@ -0,0 +1,395 @@
+package com.coderevisited.bits;%0A%0Apublic class CheckConsecutiveInGrayCode%0A%7B%0A    public static void main(String%5B%5D args)%0A    %7B%0A        int a = 0x00;%0A        int b = 0x80;%0A        if (Math.abs(GrayCodeConversion.binaryToGrayCode(a) - GrayCodeConversion.binaryToGrayCode(b)) == 1)%0A            System.out.println(%22consecutive%22);%0A        else%0A            System.out.println(%22Not consecutive%22);%0A    %7D%0A%7D%0A

Given two hexadecimal numbers find if they can be consecutive in gray code