C# Type GetEnumUnderlyingType
Description
Type GetEnumUnderlyingType
returns the underlying
type of the current enumeration type.
Syntax
Type.GetEnumUnderlyingType
has the following syntax.
public virtual Type GetEnumUnderlyingType()
Returns
Type.GetEnumUnderlyingType
method returns The underlying type of the current enumeration.
Example
//w w w .ja v a2 s . c o m
using System;
enum ABC{A,B,C}
public class MainClass{
public static void Main(String[] argv){
ABC a = ABC.A;
System.Console.WriteLine(a.GetType().GetEnumUnderlyingType());
}
}
The code above generates the following result.