==操作符

经常在编程的时候会忽略==和equals的区别。从msdn上得知

For predefined value types, the equality operator (==) returns true if the values of its operands are equal, false otherwise. For reference types other than string== returns true if its two operands refer to the same object. For the string type, == compares the values of the strings.

对于object而言,它并不是比较value的。

 

 

posted @ 2012-03-07 19:35  ChinaInterLude  阅读(127)  评论(0编辑  收藏  举报