Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Inheritance
This is my Base class
 
public class BaseClass
{
    public string property1
    {
        get;
        set;
    }
    public string property2
    {
        get;
        set;
    }
    public string property3
    {
        get;
        set;
    }
}
and this is my derived class
 
public class DerivedClass : BaseClass
{
 
    private override string property3
    {
        get;
        set;
    }
}
 
I want to hide proerty3 in derived class. but i am getting this error "virtual or abstract members cannot be private".
 
How i can hide the base class property?
 
Thanks in advance.
Posted 31-Jan-13 22:00pm
Edited 31-Jan-13 22:10pm
v3

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 369
1 Maciej Los 208
2 George Jonsson 144
3 Richard MacCutchan 140
4 Dave Kreskowiak 130


Advertise | Privacy | Mobile
Web01 | 2.8.140709.1 | Last Updated 1 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid