宇宙尽头的餐馆
做有意义的事儿
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:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment