I have the following items
Apple= 00000001 (1)
Mango= 00000010 (2)
Banana= 00000100 (4)
Grapes= 00001000 (8)
Now I am storing the fruits a user can have like this by doing or'd
UserA- 00000001(Apple) or'd 00000010(Mango) = 00000011 (i.e 3)
Now I want to check whether that user contains Apple or Banana ? Till now I am thinking this : (UserA's-Values) & (Apple|Banana ) =(Apple|Banana )
i.e (00000011)&(00000001|00000100 ) =(00000001|00000100 )
but it is not working ? May I know what I am missing ?