What is the difference between TypeOf and GetType?
Answer Posted / chirag
GetType is a call that is made at runtime on an instance of
an object.
typeof() is resolved to a call at runtime, but loads the
type from the token
for the type. They probably resolve to the same call, it's
just that
GetType requires an instance. If I didn't need the instance,
I would use
typeof.
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is the default boolean value in c#?
Explain how do I convert a string to an int in c#?
What is msil, and why should developers need an appreciation of it if at all?
Is a char?
What is collection class c#?
How can I create a process that is running a supplied native executable (e.g., Cmd.exe)?
What are the types of comment in c# with examples?
Explain the difference between event and a delegate in c#?
Does a class need a constructor c#?
What is lazy keyword in c#?
Explain the importance and use of each, version, culture and publickeytoken for an assembly.
Illustrate race condition?
What is the Signification of the "new " keyword in C#? example
Which of these statements correctly declares a two-dimensional array in c#?
What is difference between string and string builder?