Type Checking: typeof, GetType, or is?

前端 未结 14 2284
北海茫月
北海茫月 2020-11-22 00:49

I\'ve seen many people use the following code:

Type t = typeof(obj1);
if (t == typeof(int))
    // Some code here

But I know you could also

14条回答
提交回复
热议问题