# What is the purpose of an internal interface?

**URL:** <https://discuss.kotlinlang.org/t/what-is-the-purpose-of-an-internal-interface/25384>\
**Category:** Language Design\
**Created:** [August 4, 2022, 6:34pm UTC](https://discuss.kotlinlang.org/t/what-is-the-purpose-of-an-internal-interface/25384 "2022-08-04T18:34:49Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![elizarov](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/elizarov/32/2164_2.png) [@elizarov](https://discuss.kotlinlang.org/u/elizarov)\
**Post date:** [August 11, 2022, 7:22am UTC](https://discuss.kotlinlang.org/t/what-is-the-purpose-of-an-internal-interface/25384/12 "2022-08-11T07:22:55Z")

</div>

You can find some real-life examples in Kotlin libraries. For example, it can be an internal marker that an exposed implementation conforms to some internal contract, see

> <https://github.com/Kotlin/kotlinx.coroutines/blob/2c3435c9fb899988403ec54d0f40d8d6116320f1/kotlinx-coroutines-core/common/src/flow/operators/Context.kt#L263-L266>

It might also have contained some public methods, without them being exposed through any public API surface.

It can also be a part of a completely internal hierarchy of classes and interface, that are not exposed at all

> <https://github.com/Kotlin/kotlinx.coroutines/blob/3574c2feca23c3e8a1ad00b5bf92e2bf04d95060/kotlinx-coroutines-core/jvm/src/scheduling/Tasks.kt#L60-L63>

---

_[View the full topic](https://discuss.kotlinlang.org/t/what-is-the-purpose-of-an-internal-interface/25384)._
