Free AI web copilot to create summaries, insights and extended knowledge, download it at here
2339
Abstract
position in the enum class declaration.</p>
<figure id="e792">
<div>
<div>
<img class="ratio" src="http://placehold.it/16x9">
<iframe class="" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fpl.kotl.in%2FuM9BSjJ2L&display_name=Kotlin+Playground&url=https%3A%2F%2Fpl.kotl.in%2FuM9BSjJ2L&image=https%3A%2F%2Fplay.kotlinlang.org%2Fassets%2Fog-image.png&key=a19fcc184b9711e1b4764040d3dc5c07&type=text%2Fhtml&schema=kotl" allowfullscreen="" frameborder="0" height="300" width="800">
</div>
</div>
</figure></iframe></div></div></figure><p id="340b">Kotlin also provides standard convenience functions for working with enums.</p>
<figure id="272b">
<div>
<div>
<img class="ratio" src="http://placehold.it/16x9">
<iframe class="" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fpl.kotl.in%2Fka061HYs0&display_name=Kotlin+Playground&url=https%3A%2F%2Fpl.kotl.in%2Fka061HYs0&image=https%3A%2F%2Fplay.kotlinlang.org%2Fassets%2Fog-image.png&key=a19fcc184b9711e1b4764040d3dc5c07&type=text%2Fhtml&schema=kotl" allowfullscreen="" frameborder="0" height="300" width="800">
</div>
</div>
</figure></iframe></div></div></figure><p id="e716">Members can declare their own anonymous classes, as well as override base methods.</p>
<figure id="ddba">
<div>
<div>
<img class="ratio" src="http://placehold.it/16x9">
<iframe class="" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fpl.kotl.in%2F1fDGK8OPk&display_name=Kotlin+Playground&url=https%3A%2F%2Fpl.kotl.in%2F1fDGK8OPk&image=https%3A%2F%2Fplay.kotlinlang.org%2Fassets%2Fog-image.png&key=a19fcc184b9711e1b4764040d3dc5c07&type=text%2Fhtml&schema=kotl" allowfullscreen="" frameborder="0" height="300" width="800">
</div>
</div>
</figure></iframe></div></div></figure><p id="2933">Enums can also implement interfaces. Each member can specify its own implementation, or a common implementation can be provided for all members (which can then be overridden if desired).</p>
<f
Options
igure id="8de4">
<div>
<div>
<img class="ratio" src="http://placehold.it/16x9">
<iframe class="" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fpl.kotl.in%2FbXle3qOee&display_name=Kotlin+Playground&url=https%3A%2F%2Fpl.kotl.in%2FbXle3qOee&image=https%3A%2F%2Fplay.kotlinlang.org%2Fassets%2Fog-image.png&key=a19fcc184b9711e1b4764040d3dc5c07&type=text%2Fhtml&schema=kotl" allowfullscreen="" frameborder="0" height="300" width="800">
</div>
</div>
</figure></iframe></div></div></figure><p id="c2e7">You can access the constants in an enum class in a generic way using the <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/enum-values.html"><code>enumValues<t< code="">>()</t<></code></a><code> and <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/enum-value-of.html"><code>enumValueOf<t< code="">>()</t<></code></a><code> functions:</code></code></p>
<figure id="8f34">
<div>
<div>
<img class="ratio" src="http://placehold.it/16x9">
<iframe class="" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fpl.kotl.in%2FTsGNDY5WU&display_name=Kotlin+Playground&url=https%3A%2F%2Fpl.kotl.in%2FTsGNDY5WU&image=https%3A%2F%2Fplay.kotlinlang.org%2Fassets%2Fog-image.png&key=a19fcc184b9711e1b4764040d3dc5c07&type=text%2Fhtml&schema=kotl" allowfullscreen="" frameborder="0" height="300" width="800">
</div>
</div>
</figure></iframe></div></div></figure><p id="e721">Go back to <a href="https://readmedium.com/reified-type-parameters-dd70e7cc4ee1">Reified Type Parameters</a>, jump to the <a href="https://readmedium.com/table-of-contents-c52573cfa291">Table of Contents</a>, or continue to <a href="https://readmedium.com/infix-functions-f2c328941939">Infix Functions</a>.</p><figure id="8ecd"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*biBSB579iezsNvEQ_NMLBg.png"><figcaption><a href="https://www.etnetera.cz/prace-u-nas?utm_source=medium&utm_medium=GabrielShanahan&utm_campaign=KotlinPrimer&utm_content=join-our-team&utm_term=KotlinPrimer#pozice">Join me in Etnetera</a></figcaption></figure></article></body>