public class GPSUtil {
public static String gps() {
StackTraceElement s = new Throwable().getStackTrace()[1];
String str = "类:" + s.getClassName() + "文件名:" + s.getFileName() + " 方法:" + s.getMethodName() + "第" + s.getLineNumber() + "行";
return str;
}
public static void main(String[] args) {
System.out.println(GPSUtil.gps());
}
}