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: