> For the complete documentation index, see [llms.txt](https://gold.gitbook.io/kotlin/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gold.gitbook.io/kotlin/class/interface.md).

# interface

```kotlin
interface Say {
    fun hello()
    fun hi() {}    //Kotlin은 Interface의 body도 구현이 가능하다.
}

class Person() : Say {
    override fun hello() { println("Hello") }
    // body가 구현된 함수는 상속받는 클래스에서 굳이 구현할 필요가 없어 중복되는 코드를 줄일 수 있다.
}

//다중상속을 이런식으로 푼다. mix-in
```

```kotlin
interface Korean {
    fun hello() { println("안녕") }
}

interface Newyorker {
    fun hello() { println("Hello") }
}

class Person(val name: String, val age: Int) : Korean, Newyorker {
    override fun hello() {
        super<Korean>.hello()
        super<Newyorker>.hello()
    }
}

// Kotlin은 서로 다른 Interface들이 같은 method 정의 및 구현이 가능하며, 각각 호출 할 수 있다.
```
