Possible Duplicate:
When to use If-else if-else over switch statments and vice versa
I'm sure they're fundamentally very different things, but in practical use I've never found a case where there's been any difference between
switch (value){
case 1:
//Do stuff
break;
case 2:
//Do other stuff
break;
}
and
if (value == true){
//Do stuff
}
else{
//Do other stuff
}
What are some example scenarios where one is more appropriate than the other? How, conceptually, are the different? Are there performance of semantics advantages?