object 的tostring()
在.net中是这样定义的:  
  public virtual string ToString()
    {
        return this.GetType().ToString();
    }对于其他类型会重载方法。
但是对于object来说。
this.GetType()还是object.
object 的tostring的方法.是虚方法.对于object是怎么重载执行此方法呢?
对语言的理解太浅.希望明白人讲讲.

解决方案 »

  1.   

    父类调用子类的重载函数对于 Type 类, 重载如下:        // ToString
            // Print the String Representation of the Type
            public override String ToString()
            { 
                return "Type: "+Name;
            } 
      

  2.   

    http://www.cnblogs.com/mingzi/archive/2009/01/03/1367474.html
      

  3.   


    谢谢。到GetType()这里又看不懂了。
    他是怎么样判断object的类型的呢?.net只有下面代码
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern Type GetType();
      

  4.   

    object是所有的全部    不管你怎么输出他自己都会和你所输入的类型装换