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.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version