For the same reason you can declare a variable of type
Class1. Remember, the variable is not an object instance but
a reference to an instance. When you write `Class1 cref;' you
create a reference variable that can point at any object that
is an instance of Class1 or one of its subclasses. When you
write `In1 iref;' you create a reference variable that can
point at any object of any class that implements In1.
Why is it valid to call an unimplemented method of the interface?
I mean, what for, there isn't a code to execute.
The method code exists, but not in the interface definition.
The class that implements In1 provides code for all the methods
In1 describes. When you write `iref.answer(42)' you are calling
a method of the object that iref points to.