how to run the program continously...

i want to run my java program continously... i heard that by implement the thread we can run program continously... can any body give me sample code on thread which runs continously....thanks alotkareem
[230 byte] By [confident] at [2007-9-30 11:54:21]
# 1

You don't really need a thread. Just write a program which doesn't exit.public class HelloWorldForever {

public static void main(String[] args) {

while (true) {

System.out.println("Hello World");

}

}

}

But if you want a threadpublic class HelloWorldForeverThread {

public static void main(String[] args) {

Thread t = new Thread(new Runnable() {

public void run() {

while (true) { System.out.println("Hello World"); }

}

});

t.start();

}

}

bbritta at 2007-7-4 13:52:54 > top of Java-index,Administration Tools,Sun Connection...