2010-01-25

typeof() GetType() is

Suppose there are three Classes(type) Aninaml, Dog and Tree
and 3 instances animal dog and tree

if(dog is Animal) // true
dog.GetType() == typeof(Dog) // true

call to GetType gets resolved at runtime, while typeof is resolved at compile time.

No comments: