• Post Reply Bookmark Topic Watch Topic
  • New Topic

program termination  RSS feed

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a Java keyword that will terminate a program? I have a loop set up asking the user if they would like to continue. If 'yes' continue, if 'no' terminate program. I have tried 'break', 'end', and 'exit', all with no luck.

Thanks,
Dave
 
Ranch Hand
Posts: 119
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dave,

You can use System.exit(int status) method to terminate program execution.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!