package com.wyl.cn;
import java.util.TimerTask;
public class TimerTest extends TimerTask {
@Override
public void run() {
// TODO Auto-generated method stub
System.out.println("测试TimerTask========》");
String s1=this.getClass().getResource("").getPath();
String s2=this.getClass().getResource("/").getPath();
String s3=this.getClass().getResource("/com").getPath();
String s4=this.getClass().getResource("/com/wyl").getPath();
System.out.println(s1);
System.out.println(s2);
System.out.println(s3);
System.out.println(s4);
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
new TimerTest().run();
}
}
<pre name="code" class="plain">测试TimerTask========》
/D:/plantix2.0_v1.0/PlantixStudio2.0/workspace1/tasktest/build/classes/com/wyl/cn/
/D:/plantix2.0_v1.0/PlantixStudio2.0/workspace1/tasktest/build/classes/
/D:/plantix2.0_v1.0/PlantixStudio2.0/workspace1/tasktest/build/classes/com
/D:/plantix2.0_v1.0/PlantixStudio2.0/workspace1/tasktest/build/classes/com/wyl