Show me a class in your code where there could be either static or dynamic binding.
Write some mock code on this paper showing how you would set the static type and dynamic type of a variable.


Dynamic Binding
Super Class: HedgehogDialogue Source Code
public abstract class HedgehogDialogue
{
    public virtual string[] GetCurrentResponses(){
    //public string[] GetCurrentResponses(){
        return (new string [] {"wow! did you comment out virtual? this is exactly what you need for the oral exam!"});

    }
}
Sub Class: ShadowDialogue Source Code
public class ShadowDialogue : HedgehogDialogue
{
    //overridden function for oral exam
    public override string[] GetCurrentResponses() {
    //public string[] GetCurrentResponses(){
        return(currentDialogueIndex < playerResponses.Count) ? playerResponses[currentDialogueIndex] : new string[0]; 
    }
}
Virtual Function: GetCurrentResponses
Main Code: Source Code
    HedgehogDialogue sonicDialogue = new SonicDialogue(affectionManager);

Choose a dynamically bound method. What method gets called now?

Change the dynamic type. What method gets called now?

Pick a statically bound method. Which one would be called in each of the two previous cases?

Notice in the video: