I need to know how to figure out the result of the SOUT without using of PC.
public static int bits(int n) {
return n & (0xeeeeeeee|0x66666666);
}
What does it return for bits(6);? I know it returns 6, but why?
Convert the hexadecimal literals to binary literals by hand and then it will become more clear.
As this is homework, I think that this is an appropriate enough answer without giving too many details away.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With