What is the difference between TypeOf and GetType?

Answer Posted / saurabh

TypeOf(): It is an operator, which used to find the type of known type at the time of compilation of the program. It depends on the class or type and cannot pass the object or instance of the class as a parameter to the TypeOf() operator.
GetType(): This is the method, using this method we can obtain the type of the object or the type of instance of the class. To call this method we need an object or an instance of a class.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are c# objects passed by reference?

467


What is difference between constants and readonly in c#?

488


When can a derived class override a base class member?

527


What are the differences between system.string and system.text.stringbuilder classes?

488


What is nullable types in c#?

502






Explain dataadapter.update method in .net?

520


Is it good to use var in c#?

466


How to override a function in c#?

547


Define delay signing?

534


What is the purpose of static?

503


Explain acid rule of thumb for transactions in c#.

524


Why it's said that writing into .NET Application Configuration Files is a Bad Idea?

533


Is c sharp free?

544


What is string pool in c#?

537


Can we assign null value to integer?

458