Is it at all possible to create a member which would effectively be inaccessible by the class that declares it? Only derived classes would be able to access the member.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The closest you’d be looking for is
protected, which can only be accessed by the class that declares it and its derivatives. See here: http://msdn.microsoft.com/en-us/library/ms173121.aspxUnless you are referring to an
abstractclass, which can’t be instantiated and can contain method declarations without code: http://msdn.microsoft.com/en-us/library/sf985hc5(v=vs.71).aspx