Syntax:
Array Enum.GetValues(Type enumType);
Parameter:
Here we pass an instance of a specified enum.
Return value:
This method returns an array of the values of the constants in the specified enum.
Exceptions:
- System.ArgumentException
- System.ArgumentNullException
-
Program:
The source code to demonstrate the GetValues() method of Enum class is given below. The given program is compiled and executed successfully.
Output: