public class Box<T>
{
public T Value { get; set; }
}
var box = new Box<int>();
box.Value = 42;box.Value'nun derleme zamanı tipi nedir?- aobject
- bdynamic
- cint✓
- dT
Açıklama:
Box<T> tipi int ile kapatıldığında (Box<int>), tip içindeki her T yerine int geçer; bu yüzden box.Value açık tip parametresi T değil, somut int tipine sahiptir.