C#: Creating an instance of an abstract class without defining new class

前端 未结 9 786
眼角桃花
眼角桃花 2020-12-29 04:25

I know it can be done in Java, as I have used this technique quite extensively in the past. An example in Java would be shown below. (Additional question. What is this techn

9条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-29 05:21

    In short no, you have to define it as separate sub class. I think this feature is coming C# 4.0 though?

    Edit: No it's not coming C# 4.0 I made that up.

提交回复
热议问题