String path = new Object() {
public String getPath() {
return this.getClass().getResource("").getPath();
}
}.getPath();
普通方法: 直接用this.getClass().getResource("")
静态方法: 根据上面方法获取。
String path = new Object() {
public String getPath() {
return this.getClass().getResource("").getPath();
}
}.getPath();
普通方法: 直接用this.getClass().getResource("")
静态方法: 根据上面方法获取。