ayi <t>All are different.<br/> <br/> typeof takes a type name (which you specify at compile time).<br/> <br/> GetType gets the runtime type of an instance.<br/> <br/> is returns true if an instance is in the inheritance tree.<br/> <br/> Example<br/> <br/> class Animal { } <br/> class Dog : Animal { }<br/> <br/> void PrintTypes(Animal a) { <br/> Console.WriteLine(a.GetType() == typeof(Animal)); // false <br/> Console.WriteLine(a is Animal); // true <br/> Console.WriteLine(a.GetType() == typeof(Dog)); // true<br/> Console.WriteLine(a is Dog); // true <br/> }<br/> <br/> Dog spot = new Dog(); <br/> PrintTypes(spot);<br/> <br/> ```<br/> <br/> <br/> What about `typeof(T)`? Is it also resolved at compile time?<br/> <br/> Yes. T is always what the type of the expression is. Remember, a generic method is basically a whole bunch of methods with the appropriate type. Example:<br/> <br/> ```<br/> string Foo(T parameter) { return typeof(T).Name; }<br/> <br/> Animal probably_a_dog = new Dog();<br/> Dog definitely_a_dog = new Dog();<br/> <br/> Foo(probably_a_dog); // this calls Foo and returns "Animal"<br/> Foo(probably_a_dog); // this is exactly the same as above<br/> Foo(probably_a_dog); // !!! This will not compile. The parameter expects a Dog, you cannot pass in an Animal.<br/> <br/> Foo(definitely_a_dog); // this calls Foo and returns "Dog"<br/> Foo(definitely_a_dog); // this is exactly the same as above.<br/> Foo(definitely_a_dog); // this calls Foo and returns "Animal". <br/> Foo((Animal)definitely_a_dog); // this does the same as above, returns "Animal"<br/> <br/> ```</t>