+2

Difference between GetType() and typeof()

Why provide Microsoft two different methods for single work

4/1/2020 9:44:58 AM

Shashank Mishra

2 Answers

New Answer

+2

Read: https://stackoverflow.com/questions/11312111/when-and-where-to-use-gettype-or-typeof https://stackoverflow.com/questions/983030/type-checking-typeof-gettype-or-is

0

First of all, Typeof is not a function. It is a keyword which is used to define the type. While GetType() is used to get the datatype of a particular object. It can be used only on the object of a class. For further learning, you can refer the following link. https://www.c-sharpcorner.com/blogs/difference-between-typeof-and-gettype-methods1