I'm in the middle of studying the book named Beginning Android Games. One thing that I noticed was this:
int action = event.getAction() & MotionEvent.ACTION_MASK;
int pointerIndex = (event.getAction() & MotionEvent.ACTION_POINTER_ID_MASK)
>> MotionEvent.ACTION_POINTER_ID_SHIFT;
This is the firsr time I've seen a variables like that so I don't know what it does. I ran the code in java and created some sample.
If I run this code:
int i = 10 >> 500;
System.out.print("Answer " + i);
The answer would be 0? Why is that?
And if I run this code:
int i = 10 & 500;
System.out.print("Answer " + i);
At first I thought it was concatenation of value so I would assume that i = 10500 but thats not the case. The answer is the same. still 0? Anyone knows what's happening here?