在Java中,我可以用最终关键字做到这一点。我没有看到最终在C#。是否有替代品?
In java, I could do this with the 'final' keyword. I don't see 'final' in C#. Is there a substitute?
您正在寻找的密封
关键字。这不正是 Java中的最后一个
关键字一样。试图继承会导致编译错误。
You're looking for the sealed
keyword. It does exactly what the final
keyword in Java does. Attempts to inherit will result in a compilation error.