Hi,

I have a question about one of the examples in the lesson "Tour of
java.lang.* and java.util.* classes".  The example is about the
Process and Runtime classes.  Here is the example program:

1 class RuntimeDemo {
2      public static void main(String args[]) {
3           Runtime rt = Runtime.getRuntime();
4           Process proc;
5           try {
6                proc = rt.exec("regedit");
7                proc.waitFor(); //try removing this line
8           } catch (Exception e) {
9                System.out.println("regedit is an unknown
10                     command.");
11         }
12    }
13 }

When I ran the program, the Registry Editor appeared.  i tried running
the program with and without the proc.waitFor() line, and did not
notice any difference between the programs.  In both cases, the
Registry Editor appeared, and when I closed the editor, the program
stopped.

What should the different behaviors be for the two programs?  I use
NetBeans 6.5.  Thank you!

Jim Tarsi
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to