More about Virtual / new…plus interfaces!

前端 未结 6 916

Yesterday I posted a question about the new/virtual/override keywords, and i learned a lot from your answers. But still i remain with some doubts.

In between all the

6条回答
  •  天命终不由人
    2021-01-01 06:16

    "Method table"? No, it's just a contract that has to be satisfied. The contracts of I1 and I2 can be satisfied with the same Draw method, and will be, unless you separate one off with an implicit implementation, as is the case here. Without this, a single Draw method will be fine.

    In all cases, the public Draw will be called except when the reference is cast to the interface type that is explicitly implemented.

提交回复
热议问题