(int n, int i)
| 1 | public class BitOperations { |
| 2 | //Get ith Bit |
| 3 | public static int getIthBit(int n, int i) { |
| 4 | int bitMask = 1<<i; |
| 5 | return (n & bitMask) == 0 ? 0 : 1; |
| 6 | } |
| 7 | |
| 8 | //Set ith Bit |
| 9 | public static int setIthBit(int n, int i) { |
nothing calls this directly
no outgoing calls
no test coverage detected