I prepare abstract class for other classes which will derive from it. I want to create interface for my abstract class and want to define couple protected properties/methods so in abstract class after implement that interface my properties could be consumed by derived classes - properties which will be protected, however it says interface cannot have protected properties. How to overcome that?
Asked
Active
Viewed 63 times
0
-
maybe this post can help you, is related to java, but the POO concepts usually have similarities.. http://stackoverflow.com/questions/5376970/protected-in-interfaces – fingerprints Apr 04 '17 at 16:40
-
i see i cannot use it this why, i just wanted to make contract btu ok cannot be done.. – dev Apr 04 '17 at 16:49
-
1but you can define abstract methods, and you're going to have a similar behavior, I think that the syntax is with `MustOverride` in vb.net. So you can define in your father class methods which going to be overridden in all the children's.. – fingerprints Apr 04 '17 at 16:55
-
check here, an example of the implementation. http://stackoverflow.com/questions/1153804/abstract-class-method-how-to-c-sharp-vb-net – fingerprints Apr 04 '17 at 16:58