It depends on the language. In C, types exist only at compile time. In Java and C#, types exists both at compile time and runtime. In dynamic languages (like Python, JavaScript etc.) they exist only at runtime. This means
Your code example would therefore work quite different depending on the answerslanguage. In Java/C# the two calls to you questionConsole.WriteLine() actually calls two different methods. This is quitecalled method overloading - multiple methods can have the same name, as long as they have different types of parameters, so the compiler can select the correct method implementation at compile time depending on the types of the arguments. The two different methods just happen to produce the same output in this specific case.
A dynamic language on the other hand would not have method overloading, but might have a single method which behaved differently depending on the runtime type of the argument.