/*
* URI:绝对路径
*/
System.out.println("当前类ReadTest.class文件的URI\n" + ReadTest.class.getResource(""));
System.out.println("当前classpath的URI\n" + ReadTest.class.getResource("/"));
System.out.println("当前classpath的URI\n" + ReadTest.class.getClassLoader().getResource(""));
System.out.println("当前classpath的URI\n" + Thread.currentThread().getContextClassLoader().getResource(""));
System.out.println("当前classpath的URI\n" + ClassLoader.getSystemResource(""));
时间: 2024-10-14 07:27:06