Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How do I make a java program restart itself?

807603Jan 28 2008 — edited Jan 28 2008
Hello, I am trying to make my java program restart and launch itself again for a certain number of times (let's say 10). For example, for the following simple program:

class myfirstjavaprog
{
public static void main(String args[])
{
System.out.println("Hello World!");
}
}

Once the program finished its work (it prints "Hello World"), is there a way to make it restart and launch itself automatically 10 times again? I know that a FOR loop is involved, but I don't know the command or the code to make the program restart and launch itself again and again? Can anyone please help?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 25 2008
Added on Jan 28 2008
20 comments
7,283 views