8条回答
关注 package com.package2;
import java.io.File;
public class T5 {
public static void main(String[] args) { T test=new T(); test.get(); }
}
class T
{
public void get()
{
File file = new File(this.getClass().getResource("/").getPath());
System.out.println(file.toString());
}
}本回答被题主选为最佳回答 , 对您是否有帮助呢?解决评论 打赏 举报无用 1