I’ve just got a warning in my IDE that my class is abstract but it is derived from concrete class. And what? Why can’t I do so? This suites my needs very well. It’s just a warning though so the class is compilable. Just interested why it gives me this warning. Thank you.
Update
I need to extend my question with some explanations. I have this class derived from other class and I want nobody to be able to instantiate it. Moreover, I need two subclasses from this abstract class and each of them to have their own implementation of one abstract method. That’s why.
Do you think it is bad idea? What approach shall I take instead?
I think the reason is maybe that abstract classes usually serve for basic behavior/information for creating subclasses. Think about other programmers while making such a decision. Others don’t expect it.
Anyway, you can set compiler preferences not to give warnings for this type of “problem”.
Update
After reading your update I think the simplest way is to declare this class’s
constructor protected.For the abstract method: you can simply
overridethat from your subclasses, I think.