Syntax:
bool Enum.HasFlag(Enum flag);
Parameter:
Here we pass the flag of a created enum.
Return value:
This method returns the boolean value if the bit field is set then it returns true otherwise it returns false.
Exception:
- System.ArgumentException;
-
Program:
The source code to demonstrate the HasFlag() method of Enum class is given below. The given program is compiled and executed successfully.
Output:
High bits: WEST EAST High bits: WEST EAST High bits: EAST Press any key to continue . . .
need an explanation for this answer? contact us directly to get an explanation for this answer