> 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/abstract.md).

# abstract

```kotlin
abstract class Person() { //open처럼 상속이 가능한 클래스가 된다

    abstract fun hello()    //abstract는 구현체를 가질 수 없다(open과의 차이점) {...} body 없음.

    open fun hi() {  -> //open 키워드가 상속받는 쪽에서의 오버라이드를 허용한다.
        println("hi") -> //open은 구현체를 갖는다.
    }

    fun ya() {  -> //open 키워드가 없다면 property나 function은 final 취급을 받아 오버라이드 불가.
        println("ya")
    }

}

class Bar : Person() {
    override fun hello {}    //abstract는 상속받은 쪽에게 구현을 강제한다.
}
```

```kotlin
//추상클래스의 인스턴스 생성
val foo = object: Person() {
    override fun hello() {
        ...
    }
}
```

|           | abstract | open |
| --------- | -------- | ---- |
| override  | O        | O    |
| implement | X        | O    |
