Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Close method? 1

Status
Not open for further replies.

jisoo22

Programmer
Joined
Apr 30, 2001
Messages
277
Location
US
Hello all,

I'm putting together a relatively simple program in Java. One of the things I'm trying to do in it is using an if/else statement to listen for a certain string of text. Once that string appears, I want to stop the program. Is there some sort of exit() or quit() method I can implement here? Strangely enough, I can't seem to find one.

Thanks,
Jisoo22
 
System.exit(0);

this is sufficient to stop the application

Marco aka Porsche928
 
A-ha! I knew it was .exit(), I was just missing the 0!

Thanks a bunch!
Jisoo22
 
It can be System.exit(1)
u can change 1 to 2,3,4,5,6 And so on
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top