# Why a library developer should use abstract class instead of interface

DevFeed: [Why a library developer should use abstract class instead of interface](<https://devfeed.tech/articles/why-a-library-developer-should-use-abstract-class-instead-of-interface-25450.md>)

Original publisher: [Read original article](<https://hannesdorfmann.com/android/library-abstract-class/>)

Author: Hannes Dorfmann

Published: 2016-10-13T09:00:00Z

Content type: opinion

Language: en

Sources: [Hannes Dorfmann](<https://devfeed.tech/sources/hannes-dorfmann.md>)

Topics: [Library](<https://devfeed.tech/topics/library.md>), [Development](<https://devfeed.tech/topics/development.md>), [Java](<https://devfeed.tech/topics/java.md>), [Android](<https://devfeed.tech/topics/android.md>)

Tags: [abstract-class](<https://devfeed.tech/tags/abstract-class.md>), [android](<https://devfeed.tech/tags/android.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [interface](<https://devfeed.tech/tags/interface.md>), [java](<https://devfeed.tech/tags/java.md>), [library](<https://devfeed.tech/tags/library.md>)

## AI overview

The article explains why the author switched AdapterDelegates 3.0 from an interface to an abstract base class in an Android library. It compares interfaces and abstract classes, focusing on flexibility, shared behavior, state, and inheritance risks.

## Source excerpt

Use interfaces for java development they said. It will be more flexible they said. Well, that all might be true but for library projects that doesn't necessarily has to be true as well. In this post I will explain you why I have switched from interface to an abstract class as base class in one of my library projects called AdapterDelegates 3.