You can get the resources of the class path, such as files, pictures with ClassLoad's getResource () method. For example, ClassLoader.getsystemResource ("XXX") Returns the URL of a resource under the current class path. There are many usage, or ClassLoader.getsystemClassLoader (). Getresource ();
You can also use custom ClassLoader to implement the resource from other locations, that is, the path to specify a resource with the instance of UrlclassLoader, and then use the getResource (); method.
GetResource () and getResources () distinguish, the former returns only the first path of the found resource, which gets all the paths found and returns an enumeration.
GetResourceSstream uses getResource () to locate the URL, then connect to the URL, and open the InputStream on the data source.