Answers for "switch case in apex"

3

switch statement in apex

for(Integer i=1; i<=5; i++){
    Switch on i {
        when 1,2{
            System.debug('case 1 and 2');
        }
        when 5{
            System.debug('case 5');
        }
        when else{
            System.debug('case 3 and 4');
        }
    }
 }
Posted by: Guest on April-24-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language