Simple java solution
Code\n\nclass Solution {\n    public int[] evenOddBit(int n) {\n        int arr[] = new int[2];\n        int x = 0;\n        while(n > 0)\n        {\n          
# Code\n```\nclass Solution {\n    public int[] evenOddBit(int n) {\n        int arr[] = new int[2];\n        int x = 0;\n        while(n > 0)\n        {\n            int rem = n % 2;\n            if(x == 0)\n            {\n                x = 1;\n                if(rem == 1)\n                arr[0]++;\n            }\n            else\n            {\n                x = 0;\n                if(rem == 1)\n                arr[1]++;\n            }\n            n /= 2;\n        }\n        return arr;\n    }\n}\n```
['Java']