.NET Fiddle

CSharp · Console

/Program.cs

using System;
using System.Collections.Generic;
					
public class Program
{
	public static void Main()
	{
		
		List<A> basetypelist = new List<A>();
		basetypelist.Add(new B());
		basetypelist.Add(new A());
		
		foreach(var a in basetypelist)
		{
			Console.WriteLine(a.GetType());
		}
		
	}
}
public class A
{
		
}
public class B : A
{
		
}
;