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.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.