[Java] interface vs abstractClass

During developing on Java, I have needed to choose which to use interface or abstractClass. So I searched a little.

[Java] interface vs abstractClass

Goal

To get an advice for choosing between interface with default methods and abstractClass

The thing is

As I’m using default methods in interfaces, they seems not to have any differences. So I became wonder, which one to use? If I change from interfaces to abstract classes, won’t it be matter?

Differences

Still, there were differences.

Dicision

As I didn’t want to occupy the only chance for extending, and there were not clear hierarchies, I decided to use interfaces. Now, the problem is accessing to the state. In interface, there were no way to force a object to holds certain states. I can try forcing some getter methods but its purpose may look vague for the other developers. I think this happened because I referenced many python codes, where multi inheritance is available. And I also found saying there is a way to serve both interface and abstractClass for user’s convenience, but for now, I think that’s too much.

References