if(TT=="2")这个不能相当于tt.Tostring()=="2"
如果是相当于,那么If(TT=="2")应该为True,结果我们发现它为false.
我个人认为 TT本质是int类型,只是通过装箱将整型托管到堆上。原则上没有改变其类型。
其次我们在使用if(TT=="2")时,编程会提示一个警告信息:Possible unitended reference comparison;to get a value comparsion, cast the left hand side to type 'string'.
也就是说确定不了TT到底转换成什么类型的值,因为Object是所有类的基类。故返回的结果为false.