Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

switch expressions

//called: switch expressions

int number= 2;

string result = number switch
{
    0 => "zero",
    1 => "one",
    2 => "two",
    _ => "default"
};

Console.WriteLine(result);
 
PREVIOUS NEXT
Tagged: #switch #expressions
ADD COMMENT
Topic
Name
2+2 =