Is it possible to create virtual class to force the class must inherited?

  • Thread starter Thread starter ABC
  • Start date Start date
A

ABC

as subject.

I have two classes, one is sealed class that will call or access the another
class properties or methods. But, now, the another class is for future use
and unknow what properties will add. I don't want to modify sealed class
when the another class properties or new methods added. Is there any best
strategies?
 
ABC said:
I have two classes, one is sealed class that will call or access the another
class properties or methods. But, now, the another class is for future use
and unknow what properties will add. I don't want to modify sealed class
when the another class properties or new methods added. Is there any best
strategies?

It's not entirely clear what you mean, but I *suspect* you're after
interfaces or abstract classes. You put in the interface (or abstract
class) all the things that the sealed class cares about, and then that
can be implemented/derived from by other classes.

Jon
 
Back
Top