1.class.getResourceAsStream() 从源码中可以看出他也是调用ClassLoader的getResourceAsStream() public InputStream getResourceAsStream(String name) { //对资源名进行解析 name = resolveName(name); ClassLoader cl = getClassLoader0(); if (cl==null) { // A system class. return Clas…