Is there something in c# similar to java's @override annotation?

前端 未结 4 694
生来不讨喜
生来不讨喜 2021-02-18 23:48

I\'ve used the @Override in java and has come in quite handy. Is there anything similar in c#?

4条回答
  •  感情败类
    2021-02-19 00:06

    No, yes. It makesn o sesne to have an anotation because in C# there is an override kkeyword in the langauge and the compiler warnds if you "hide" a method. So, either you say "new" or "override" directly as part of the method.

    Java basically uses the annotation to hide a mistake in the langauge specifications.

    Please read the language specificastions for C#. Completely.

提交回复
热议问题