The Type Switch

In this lesson, you'll learn how to use the switch statement to determine the type of interface and writing cases accordingly.

We'll cover the following

Testing the type of interface #

The type of an interface variable can also be tested with a special kind of switch: the type-switch. Look at the following program:

Get hands-on with 1200+ tech skills courses.