Getting the Pair class module

If we go with JDK 9 modularity, then our classes will live inside modules. The Pair class is not in a module, but we can easily get the module of a class via JDK 9's Class.getModule() method (if the class is not in a module, then this method returns null):

// null, since Pair is not in a Module
Module module = clazz.getModule();
..................Content has been hidden....................

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