samedi 12 octobre 2019

Kotlin get declared member property value

What is the equivalent code of Class#getDeclaredField in Kotlin? I'm looking for a pure Kotlin implementation... a reflection perhaps?

class Test {
    public static final String TEST = "Hello";
    public static void main(String[] args) {
        System.out.println(
            Test.class.getDeclaredField("TEST").get(Test.class));
    }
}




Aucun commentaire:

Enregistrer un commentaire