Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!news.swapon.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: markspace Newsgroups: comp.lang.java.programmer Subject: Re: Help with methods, classes and parameters Date: Thu, 31 Jul 2014 09:45:10 -0700 Organization: A noiseless patient Spider Lines: 20 Message-ID: References: <53d993b9$0$299$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 31 Jul 2014 16:45:13 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="9358cda03e1e0dfd3c4b757daa608707"; logging-data="30978"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+s0jHcbYTolCCDyVSAiiifwwRnbi7w5ng=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: Cancel-Lock: sha1:Tuw8zUt1yqzVQnBRU3AIrfFUS0M= Xref: csiph.com comp.lang.java.programmer:29457 On 7/30/2014 10:01 PM, Scott Dunning wrote: > I have another quick question. One of the options in in the menu is if > the user enter 0 to quit the program. I'm not sure how to go about that > in the switch statement? You can execute a 'return' anywhere in a method to simply exit the method. From 'main' it will just exit the program. switch (optionInt) { case 0: return; break; I left in the break because when you edit a program, sometimes you forget and change things, and the break helps prevent an unexpected fall through when you make a change. It doesn't hurt anything to leave it in even though the break is extraneous.