 <p>No. You see, <code>switch</code> statements are for comparing many different values of the same type for a match to a certain other value.</p> <p>A <code>switch</code> statement is formed like this:</p> <pre><code>switch (var){ case 5: //var == 5 break; case 10: //var == 10 break; default: //var is not 5 nor 10 break; } </code></pre> <p>Which only allows comparisons to constant values, thus making it useless towards data types. An if statement is a much better choice for this purpose, as the only solution for using a switch statement (getting the instance name and comparing it in that format) would be writing too much extra (and unnecessary) code that is not needed and can more easily be done in another manner.</p>