Defining array in switch case
If you want to declare multiple variables with the same name inside different case statements, you can enclose the code inside each of them inside curly braces:

case 1:{
    Code...
break;}
case 2:
...


The curly braces will set the limits for the variables scope to just this case.