13-The switch statement of the program execution flow

table of Contents

  • Convert Arabic numerals to Chinese numerals
  • Use the switch statement to simplify the program
  • break in switch syntax
  • Summary of switch statement syntax points

1. Convert Arabic numerals to Chinese numerals

  • It can be done with if, but it's not neat enough
  • According to the comparison of two values, entering a certain code block is most suitable for this situation
public class IfElseNum {
   
    
    
    public static void main(String[] args) {
   
    
    

        int n = 1

Guess you like

Origin blog.csdn.net/qq_33254766/article/details/108955691