강의

멘토링

커뮤니티

Inflearn Community Q&A

shafeel22040's profile image
shafeel22040

asked

Yoon Jae-seong's Google's official language, Kotlin, for getting started with programming

Lesson 34 Reflection

34강 리플렉션강의중에서

Written on

·

439

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
}

androidkotlin

Answer 3

0

softcampus님의 프로필 이미지
softcampus
Instructor

implementation "org.jetbrains.kotlin:kotlin-reflect:최신버전"

형태로 라이브러리 추가해보세용


0

shafeel2님의 프로필 이미지
shafeel2
Questioner

참고로 저는 Intellij 로 코딩연습하고 있습니다

0

shafeel2님의 프로필 이미지
shafeel2
Questioner

위코드를 실행하면 아래와 같은 에러가 발생합니다

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)

shafeel22040's profile image
shafeel22040

asked

Ask a question