Easy Java Solution
\n# Code\n\nclass Solution {\n    public int[] evenOddBit(int n) {\n        String s= Integer.toBinaryString(n);\n        int arr[]=new int[s.length()];\n      
\n# Code\n```\nclass Solution {\n    public int[] evenOddBit(int n) {\n        String s= Integer.toBinaryString(n);\n        int arr[]=new int[s.length()];\n        int a=0;\n        for(int i=s.length()-1;i>=0;i--){\n            int x=Integer.parseInt(String.valueOf(s.charAt(i))); \n            arr[a]=x;\n            a++;\n        }\n        int ans[]=new int[2];\n        int even=0;\n        int odd=0;\n        for(int i=0;i<arr.length;i++){\n            if(arr[i]==1){\n                if(i%2==0)\n                    even++;\n                else\n                    odd++;\n            }\n        }\n        ans[0]=even;\n        ans[1]=odd;\n        return ans;\n    }\n}\n```
['Java']