What is the difference between typeof and the is keyword?

前端 未结 6 1085
太阳男子
太阳男子 2021-01-03 19:11

What\'s the exact difference between the two?

// When calling this method with GetByType()

public bool GetByType() {
    // this ret         


        
6条回答
  •  忘掉有多难
    2021-01-03 19:59

    • typeof(T) returns a Type object
    • Type is not AClass and can never be since Type doesn't derive from AClass

    your first statement is right

提交回复
热议问题