Running the program
Let's go ahead and run this. Go to Debug > Start Without Debugging
or use Ctrl + F5. You should see the following:

Figure 5.2: The Debug screen
It should say I move by flapping my fins.
, which is correct. Now, let's head back to our code and change it so that we create a Human
object, rather than Fish
. The changed line should read as follows:
Movable movableObject = new Human();
All we've done here is replace Fish
with Human
; we're creating a different type of object. Let's go ahead and run this new code. Go to Debug > Start Without Debugging
and you should see the following:

Figure 5.3: The Debug screen
Perfect! Close this and there you go. This is the new power of switch
blocks in C# 7. You can now pass in a whole object unlike before. Here's the complete code from this chapter:
using static System.Console; //needed for WriteLine interface Movable { void Move(); //this method has to be implemented by classes that implement the interface Movable } class...