I'm trying to make a dynamic method to check a number through binary anding. I've tried a variety of different approaches but just can't wrap my head around it.
what I need is a method that converts an integer index position and returns a boolean.
private boolean bitwiseAnding(int val, int indx){
//TODO Convert indx to a bitmask here
return (val & bitmask)==1;
}
for example:
1 = 0x01
2 = 0x02
3 = 0x04
4 = 0x08
and so on