Skip to content
This repository was archived by the owner on Jul 29, 2023. It is now read-only.

Latest commit

 

History

History
19 lines (13 loc) · 440 Bytes

File metadata and controls

19 lines (13 loc) · 440 Bytes

switch and case

  • A case or switch statement is a type of selection control mechanism used to allow the value of a variable or expression to change the control flow of program execution via a multiway branch.
new.int,switchtest=23;

switch,switchtest;

case,1->console.println("switchtest is 1");
case,23->console.println("switchtest is 23");
case,2->console.println("switchtest is 2");

Output:

switchtest is 23