Syntax:
Type Enum.GetUnderlyingType(Type enumType);
Parameter:
Here we pass an instance of specified enum to get the underlying type
Return value:
This method returns the underlying type of the specified enumeration.
Exceptions:
- System.ArgumentException
- System.ArgumentNullException
-
Program:
The source code to demonstrate the GetUnderlyingType() method of Enum class is given below. The given program is compiled and executed successfully.
Output: