When to use If-else if-else over switch statements and vice versa [duplicate]
As with most things you should pick which to use based on the context and what is conceptually the correct way to go. A switch is really saying “pick one of these based on this variables value” but an if statement is just a series of boolean checks. As an example, if you were doing: … Read more