Разницу можно увидеть с помощью такого кода:
class Base { }
class Derived : Base { }
class Program
{
static void Main()
{
ShowType( new Derived() );
}
static void ShowType( Base b )
{
Console.WriteLine(typeof(Base));
Console.WriteLine(b.GetType());
}
}
Будет напечатано:
Base
Derived
1 comment:
Спасибо понравилось !
Post a Comment