What is the difference between typeof() and GetType()?
By in C# on Jul 26 2006
  • Kiran  Babu
    Jul, 2006 26

    // Obtain type information from a variable.
    SomeType c = new SomeType();
    Type t = c.GetType();
    INeedYourTypeInfo(t);

    // Obtain type information via typeof.
    INeedYourTypeInfo(typeof(SomeType));

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS