Getting the type descriptor string for a class

Starting with JDK 12, we can obtain the type descriptor of a class as a String object via the Class.descriptorString() method:

// Lmodern/challenge/Pair;
System.out.println("Type descriptor of Pair: "
+ clazz.descriptorString());

// Ljava/lang/String;
System.out.println("Type descriptor of String: "
+ String.class.descriptorString());
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.68.28