Consider i to be a binary number. cosisting of n bits ie 1,2…j…n;
It is talking about that j(some position in the number) in the binary representation of i.
“A bit is set” in terms of a binary number is simply to see if the value at that bit is 1 or not.
If value=1 bit is said to be “set”.
So if,
i=000- None of the bits are said to be set.
i=001- 3rd bit is said to be set(starting from left)
i=100- 1st bit is said to be set(Starting from left)
i=110- 1st and 2nd bit are said to be set
And coming to java, i don’t know if there’s a shortcut but you could find the actual binary representation (might be naive,very costly and give TLE) but in c/c++ there are bitwise operators available!