oop - How do I prevent code from creating instances of a base class? -


Assume that I inherited from circle and triangle classes Size class My question is how do I stop making the example of the size class?

You make the shape class abstract As the basis of the classes, there is an incomplete service which provides extra functionality.

For example, if you have loaded classes, then you have an abstract class DataLoader and solid class DatabaseLoader , XmlLoader ...

Comments