> For the complete documentation index, see [llms.txt](https://y2kot.gitbook.io/untitled/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://y2kot.gitbook.io/untitled/patterns/creationals-patterns/prototype/realizacii-na-kotlin.md).

# Реализации на Kotlin

Prototype

## Общая реализация на языке Kotlin

{% tabs %}
{% tab title="Candy" %}
{% code fullWidth="true" %}

```kotlin
data class Candy(
    val name: String,
    val taste: String,
    val manufacture: String
)
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% code lineNumbers="true" fullWidth="true" %}

```kotlin
fun main() {
    val myCandy = Candy("Mishka","delicious", "Noname")
    val sistersCandy = myCandy.copy()

    println("Is candies equals: ${myCandy == sistersCandy}")
    println("My candy: ${System.identityHashCode(myCandy)}")
    println("Sisters candy: ${System.identityHashCode(sistersCandy)}")
}
```

{% endcode %}
