Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Java 

Return statement for beginning of a switch?

You could wrap all of your code in a while statement.
pseudo-code example:
Code
while (!inputString.equals("exit")) {...}
Yes, you could do that as well, it's not good code (to use while(true)) after all, but it's probably good enough for your class :)
No it wouldn't. You have to use "return;" instead of "break;" in case 6.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Java] by OBAMASELFApr 23, 2019 12:42 AM 4 245 Apr 23, 2019 12:42 AM
Last Post: Joseph Stalin
[Java] by blackcoder00Mar 11, 2019 07:20 AM 5 245 Mar 11, 2019 07:20 AM
Last Post: blackcoder00
[Java] by KusoApr 30, 2017 07:23 AM 11 414 Apr 30, 2017 07:23 AM
Last Post: Owl