Suppose I run two java programs simultaneously on the same machine. Will the programs run in a single instance of JVM or will they run in two different instances of JVM?
What you could do is use two separate threads. For exampe
new Thread() { public void run() { System.out.println("this is running separately from the main thread!"); } }.start();
If you want two separate programs to interact you would need to use sockets