I have 2 classes one is a simple one
Sample.java
public class Sample {
public static void main(String args[]) {
System.out.println("Hello World!!!!!");
}
}
Other one is something like this
Main.java
public class Main
{
public static void main(String[] args) throws Exception
{
Runtime.getRuntime().exec("java Sample");
}
}
I am basically trying to run the Main.java program to call Sample.java in a new command prompt...that is a new cmd that should open and print the output of Sample.java...how should I do this...???