C# Type IsAbstract
Description
Type IsAbstract
gets a value indicating whether the Type
is abstract and must be overridden.
Syntax
Type.IsAbstract
has the following syntax.
public bool IsAbstract { get; }
Example
The following example returns true if the specified object is abstract; otherwise, it returns false.
/*w ww. j a v a 2s . co m*/
using System;
using System.Reflection;
public abstract class MyAbstractClass
{
}
public class MyClass
{
}
public class Type_IsAbstract
{
public static void Main()
{
Console.WriteLine((typeof(MyAbstractClass).IsAbstract));
Console.WriteLine((typeof(MyClass).IsAbstract));
}
}
The code above generates the following result.