I am currently taking Intro programming classes. We are learning Java SE (eventually moving up to Java EE). I have a grasp on most things, but I hit a wall with bitwise manipulation and masking. For example:
EDITED HERE: I want to figure out if a number is divisible by 3 and 5, but not 2. The only requirements is that I can not use % to find the answer, it has to be in a method call, and I have to use masking and bitwise operands.
I already learned how to determine if a number is odd or even with this:
public static boolean isEven(int num) {
return ((num & 1) == 0);
}
I understand what the bitwise operands (&, |, ^, >> , <<) do but can't actually implement them properly. Our book also does not have information on this, it's from our teachers notes. I'm not asking for just the answer, I need to understand how it actually works.