Home  >  Article  >  Java  >  Try This: Complete the Java help system

Try This: Complete the Java help system

WBOY
WBOYOriginal
2024-07-17 19:57:03536browse

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 selection in the menu.

  1. Copy Help2.java into a new file called Help3.java

  2. 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.

  3. Change the menu loop as shown here:
    Image description

Note that this loop now includes break and continue statements. It also accepts the letter q as a valid option.

  1. Expand the switch statement to include the break and continue statements, as shown below: Image description

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Check Loop in LinkedListNext article:Check Loop in LinkedList