Console.WriteLine(3 & 3);
MyFlags flags = MyFlags.Flag4 | MyFlags.Flag3;
if ((flags & MyFlags.Flag1) != 0 | (flags & MyFlags.Flag2) != 0)
Console.WriteLine("Flag1 or Flag2 is set");
Console.WriteLine("Flag1 and Flag2 are not set");
it will do the same as &, where it goes down the list of bits, compares them using the | rule, and then adds the end result to the final result
( 0 | 0 ) - returns 0/false
( 1 | 0 ) - returns 1/true
( 0 | 1 ) - returns 1/true
( 1 | 1 ) - returns 1/true
so the end result will be ( 0 1 1 1 ), which is 7