Skip to content

What is the point of AbstractClassWithoutAbstractMethod? #3044

Answered by jsotuyod
GuyPaddock asked this question in Q&A
Discussion options

You must be logged in to vote

I believe the point of having an abstract class is to mark it as "incomplete", therefore, having no reason to instantiate it.

However, when an abstract class provides no abstract methods, it's unclear what's missing for it to be complete and usable. What particular behavior is it missing? This lends itself to think the class may not be actually incomplete, but the non-instantiability is arbitrary / artificial and not part of a pure Object Oriented Design (ie: getting an Hibernate mapping right).

An abstract class with no abstract methods can be simply constructed with an empty anonymous class new MyAbstractClass() {}. Why is this valid when new MyAbstractClass() is not? How is this any di…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by adangel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #933 on January 15, 2021 09:37.