엄청 중요하다. 여기는 나중에 다시 제대로 정리해 놓자
구현부가 있는 함수 -> open함수로 기본적으로 간주(별도의 키워드 없어도됨)
interface A{
fun c(){
print("asd") //open생략
}
}
구현부가 없는 함수 -> abstract함수로 기본적으로 간주(별도의 키워드 없어도됨)
interface A{
fun c(){
print("asd") //abstract 생략
}
}
open abstract 없어도 서브클래스에서 구현, 재정의 가능(서브클래스에서는 override 써야함)
Interface a{
}
Interface a2{
}
open class a3{
}
class b: a(),a,a2 {
}fun main(){
}
interface run{
fun r() //abstract 생략
}
interface eat{
fun e(){ //open 생략
print("내ㅑㅁ")
}
}
class ddog : run, eat{ //dog는 두인터페이스 상속받은 서브클래스
override fun e() {
super.e()
}
override fun r() {
TODO("Not yet implemented")
}
}