-
카테고리
-
세부 분야
프로그래밍 언어
-
해결 여부
미해결
34강 리플렉션강의중에서
23.08.28 18:29 작성 조회수 210
0
class TestClass() {
constructor(a:Int) : this() {
}
constructor(a:Int, b: Int) : this() {
}
fun testMethod() {
}
}
fun main(){
val t1 : TestClass = TestClass()
println("추상클래스인지아닌지: ${t1::class.isAbstract}") // 변수명: company_name
}
답변을 작성해보세요.
0
0
0
shafeel2
질문자2023.08.28
위코드를 실행하면 아래와 같은 에러가 발생합니다
Exception in thread "main" kotlin.jvm.KotlinReflectionNotSupportedError: Kotlin reflection implementation is not found at runtime. Make sure you have kotlin-reflect.jar in the classpath
at kotlin.jvm.internal.ClassReference.error(ClassReference.kt:88)
at kotlin.jvm.internal.ClassReference.isAbstract(ClassReference.kt:62)
at MainKt.main(Main.kt:16)
at MainKt.main(Main.kt)
답변 3