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


Please Help Members By Posting Answers For Below Questions

What is difference between dictionary and hashtable?

528


Do events have return type c#?

511


Are objects passed by reference in c#?

526


Is stringbuilder thread safe c#?

480


What is the reason behind the invention of c#?

637






Is c# dictionary a hash table?

483


What are jump statements in c#?

509


Can destructors have access modifiers?

571


What is difference between gridview and form view?

544


What is the difference between function and method in c#?

455


How is a string immutable?

497


if we are updating a database using thread, and mean while application crashes or thread being aborted then what will happen in Database? Rollback or Database will be updated? Please explain with different scenario.

1924


What is the difference between internal and protected in c#?

440


What is the full form of GAC? Explain its uses?

579


Where do I put dll files?

575