Please note that the content of this book primarily consists of articles available from Wikipedia or other free sources online. In computer programming, a switch statement is a type of selection control statement that exists in most modern imperative programming languages (e.g., Pascal, C, C++, C#, and Java). Its purpose is to allow the value of a variable or expression to control the flow of program execut ...Full description
Please note that the content of this book primarily consists of articles available from Wikipedia or other free sources online. In computer programming, a switch statement is a type of selection control statement that exists in most modern imperative programming languages (e.g., Pascal, C, C++, C#, and Java). Its purpose is to allow the value of a variable or expression to control the flow of program execution via a multiway branch (or "goto", one of several labels). The main reasons for using a switch include improving clarity, by reducing otherwise repetitive coding, and (if the heuristics permit), offering the potential of faster execution through compiler optimization. In some programming languages, a statement that is syntactically different but conceptually the same as the switch statement is known as a case statement, select statement or inspect instruction.