What is the difference between TypeOf and GetType?
Answer Posted / brijen.patel
TypeOf and GetType Produce the same information but the
difference is where they get theis information from;
typeOf is used to get the type based on a class, that means
if you use typeOf with object, it will gives you error. you
must pass class as parameter. Whereas GetType is used to
get the type based on as object (an instance of a class)
means GetType needs parameter of object rather than class name.
| Is This Answer Correct ? | 18 Yes | 0 No |
Post New Answer View All Answers
Should I use double or float?
What's the difference between abstraction and encapsulation?
What is difference between the "throw" and "throw ex" in .net?
what is main function of alternate teamplate of datalist?
What is difference between overloading and short circuiting?
What are the differences between a class and a struct?
What is the purpose of namespace in c#?
Is it possible to have different access modifiers on the get/set methods of a property?
When should I throw an exception?
What are examples of desktop applications?
What are primitive data types in c#?
What is the difference between convert and parse in c#?
Can you use all access modifiers for all types?
List some Advantages of switch-case over if else?
What is toint32 c#?