tags:

views:

23

answers:

1

How will be the syntax in java if someone try to run a java program in a CMD then if he close the CMD, there will be a message or prevent the user to close the program.

+3  A: 

You can't do this with a console application as the OS will simply close the console and terminate your process. In GUI applications there usually are events that are fired when a window is closed which you could intercept.

Joey