C# Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 332 Page Views: 

Write the difference between TypeOf and GetType?



Posted By: Avi Date: 1 October 2010 11:33:31 AM
 Answer:

Both of them produce the same information. The difference lies that from where the information is got. typeOf is used to get the type based on class. It will give an error if typeOf is used with the object. GetType is used get the type based on object, which states that geType needs parameter of object.


Posted By: avibtech


Date: 1 October 2010 11:33:31 AM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image 1FEpDN
Related Questions
C# : How would you implement inheritance using VB.NET/C#?

How would you implement inheritance using VB.NET/C#?

When we set out to implement a class using inheritance, we must first start with an existing class f....
Category: C# Date: 2/5/2010 1:49:08 PM
C# : How does VB.NET/C# achieve polymorphism?

How does VB.NET/C# achieve polymorphism?

By using Abstract classes/functions.
Category: C# Date: 2/5/2010 1:47:04 PM
C# : What is "out" keyword in C#?

What is "out" keyword in C#?

The "out" keyword causes arguments to be passed by reference. This is similar to the ref k....
Category: C# Date: 12/5/2009 12:09:31 AM
C# : What is the difference between Close() and Dispose() methods in C#?

What is the difference between Close() and Dispose() methods in C#?

The main difference between Close() and Dispose() method is, when Close() method is called, any mana....
Category: C# Date: 12/4/2009 11:14:47 PM
C# : Does C# support multiple inheritance?

Does C# support multiple inheritance?

C# does not support multiple inheritance. But C# allows to implement multiple inheritence using inte....
Category: C# Date: 11/30/2009 2:36:09 PM