Groovy web console

subscribe to the feed Subscribe
to this
site

Untitled

Published 4 weeks ago by Anonymous
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
class Test {
    String[] toto = []
    int tutu
    List<String> tata = ["a","b"]
}

if (Test.class.getDeclaredField("tata").type == List.class) {
    println "tata OK"
} else {
    println "tata KO"
}

if (Test.class.getDeclaredField("toto").type == String[].class) {
    println "toto OK"
} else {
    println "toto KO"
}
if (Test.class.getDeclaredField("tutu").type == int) {
    println "tutu OK"
} else {
    println "tutu KO"
}