Basit Timer Yapımı
import java.util.Timer;
import java.util.TimerTask;
public class timer
{
public static void main(String args[])
{
// System.out.println(args[0].length());
// System.out.println(args[0].substring(args[0].length()-2));
TimerTask task = new TimerTask()
{int i;
public void run()
{
i++;
System.out.println(i + "-merhaba");
if (i == 5) { System.exit(0); }
}
};
Timer t = new Timer();
t.schedule(task, 0, 1000);
}
}
import java.util.TimerTask;
public class timer
{
public static void main(String args[])
{
// System.out.println(args[0].length());
// System.out.println(args[0].substring(args[0].length()-2));
TimerTask task = new TimerTask()
{int i;
public void run()
{
i++;
System.out.println(i + "-merhaba");
if (i == 5) { System.exit(0); }
}
};
Timer t = new Timer();
t.schedule(task, 0, 1000);
}
}
Yorumunuzu Ekleyin