ads

Tuesday, June 23, 2009

Prevent a Class to be inherited C#

The sealed can be used to prevent a class to be inherited.

sample:
    sealed class FileClass
    {
        sealed FileClass(string filepath)
        {
            Filepath = filepath;
        }
   
        private string _filepath;
        public string Filepath
        {
            get { return _filepath;}
            set { _filepath = Filepath; }
        }
    }

No comments:

Google Search