This version adds break and continue syntax.
It also allows the user to request the syntax of more than one statement. It does this by adding an external loop that runs until the user enters q as a menu selection.
Copy Help2.java into a new file called Help3.java
Include all program code in an infinite for loop. Exit this loop, using break, when a letter q is inserted. Since the loop encompasses the entire program code, exiting it causes the program to terminate.
Change the menu loop as shown here:
Notice that this loop now includes break and continue statements. It also accepts the letter q as a valid option.
The above is the detailed content of Try This: Complete the Java help system. For more information, please follow other related articles on the PHP Chinese website!