新手学习 敬候佳音

解决方案 »

  1.   

    可以
    public abstract class AttachmentParserBase
    {
    protected Stream m_OutputStream = null;
    protected StreamReader m_Reader = null;
    protected string m_EndBoundary = string.Empty;
    protected VirtualLogUtil m_logger = null;
    protected string m_BufferStr = string.Empty;

    public AttachmentParserBase(StreamReader input, Stream output, string boundary)
    {
    m_Reader = input;
    m_OutputStream = output;
    m_EndBoundary = boundary;
    }
      

  2.   

    请问楼上两位下面这段代码怎么理解    public abstract class Permission
        {
            Dictionary<string, object> dictionary;
            public Permission()
            {
                this.dictionary = new Dictionary<string, object>();
            }
    }
      

  3.   


    8楼正解,抽象类是允许定义构造函数的,不过一般都是用来在子类实例化的时候调用,带参的要在子类利用base显式调用,所以,一般建议设置成protected的
    public abstract class Permission
        {
            Dictionary <string, object> dictionary;
            protected Permission()
            {
                this.dictionary = new Dictionary <string, object>();
            }         protected Permission(string str)
            { }
    }public class AA:Permission
    {
         public AA(){}
         public AA(string str):base(str)
         {
          }
    }
      

  4.   

    能有构造方法,
    但抽象类是不能new的.
      

  5.   

    sorry,回的时候只见一二楼,误伤哈,在6楼解释过 楼上两位是指一二楼的