using System; public class MyClass {} public abstract class MyAbstractClass {} public class Program { public static void Main() { Console.WriteLine(typeof(MyClass).IsConcrete()); // true Console.WriteLine(typeof(MyAbstractClass).IsConcrete()); // false } }
using System; public interface MyInterface {} public class Program { public static void Main() { Console.WriteLine(typeof(MyInterface).IsConcrete()); // false } }This example defines an interface `MyInterface`. Since interfaces cannot be instantiated, they are not considered concrete classes. The `IsConcrete()` method is used to determine whether `MyInterface` is a concrete class (which it is not). The System Type IsConcrete method is a part of the .NET Core library.