Take the following code:
IFoo foo = new FooImplementation();
The identifier foo has two types:
IFoo is the type that the compiler will execute. I can only call methods that are part of the IFoo contract, otherwise I will get a compiler error.FooImplementation is a type known at runtime. I can disable foo before FooImplementation at runtime, and then call non-IFoo FooImplementation .
My question is: What is the correct terminology for these two types. I could swear that we were taught at school that IFoo is a static type of identifier, and FooImplementation is its dynamic type, but after a long search on Google I can not find links to this.
source share