I'm translating a part of code from C# program to Java where is defined a [Flag] enum like this:
[Flags]
public enum ClientFlags
{
None = 0x00000000,
Flag1 = 0x00000001,
Flag2 = 0x00000002
...
And on runtime make mask operations like like
ClientFlags.Flag1| ClientFlags.Flag2
in my java code i've replicated same class without enum:
public static byte None = (byte)0x0;
public static byte Flag1 = (byte)0x01;
public static byte Flag2 = (byte)0x02;
But when i made same operations like
byte flags = ClientFlags.Flag1 | ClientFlags.Flag2
then result is different!! How I can replicate same operations in java? Can you help me?