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 I can do with c#?
What is static classes?
What is dataset and dataadapter in c#?
What are extender provider components? Explain how to use an extender provider in the project.
Give an example of a directcast.
What exception can an overridden method throw in comparison with the method it is overriding?
What is inumerable?
How to get the sum of last 3 items in a list using lambda expressions?
what will be the output of the given below coding. using System; public class Exercise { static void OddNumbers(int a) { if (a >= 1) { Console.Write("{0}, ", a); a -= 2; OddNumbers(a); } } public static int Main() { const int Number = 9; Console.WriteLine("Odd Numbers"); OddNumbers(Number); Console.WriteLine(); return 0; } }
What is the main usage of keyword “virtual†? How does it work for a method or property?
How can we sort the elements of the array in descending order?
What is serialization in c#?
Give an example to show for hiding base class methods?
Describe the process of “exception handling implementation” in c#?
Explain the mechanism of VB.NET/C# achieve polymorphism?