this.getclass().getclassloader().getresourceasstream(String file); 可以加载文件,比如xml。 转载于:https://www.cnblogs.com/zhaojia-dream/p/3418272.html