java常用关键词关键字,方法源码解析

  • transient
  • volatile
  • native
  • final
  • Integer
  • String
  • Class &&Object
  • newInstance Class.forName,ClassLoader.loadClass
  • ClassLoader .getResources(), ClassLoader.getSystemResources()

ClassLoader .getResources(), ClassLoader.getSystemResources()

 public Enumeration<URL> getResources(String name) throws IOException {
        @SuppressWarnings("unchecked")
        Enumeration<URL>[] tmp = (Enumeration<URL>[]) new Enumeration<?>[2];
        if (parent != null) {
            tmp[0] = parent.getResources(name);
        } else {
            tmp[0] = getBootstrapResources(name);
        }
        tmp[1] = findResources(name);

        return new CompoundEnumeration<>(tmp);
    }
 public static Enumeration<URL> getSystemResources(String name)
        throws IOException
    {
        ClassLoader system = getSystemClassLoader();
        if (system == null) {
            return getBootstrapResources(name);
        }
        return system.getResources(name);
    }

猜你喜欢

转载自www.cnblogs.com/wongandy/p/11517622.html