An abstract class can only be used as a base class which is extended by some other class, right? The constructor(s) of an abstract class can have the usual access modifiers (public, protected, and private (for internal use)). Which of protected and public is the correct access modifier to use, since the abstract type seems to indicate that technically a public constructor will act very much protected? Should I just use protected on all my constructors?
An abstract class can only be used as a base class which is extended
Share
An abstract class’s constructor can only be called from the implementation’s constructor, so there is no difference between it being public or protected. E.g.: