学习xml时需要获取xml的path路径。
String path = Test.class.getClassLoader().getResource("xxx.xml").getPath();
结果出现空指针异常
查阅(https://blog.youkuaiyun.com/NewObjectMe/article/details/102820933)后得知,解决方法为
在(主菜单File–>Project Structure…–>Modules–>当前项目所在的位置)中找到项目的资源文件,
后点击resources
然后就成了!