你可以修改抽象类和interface.if修改是可能的,否则为什么不允许

你可以修改抽象类和interface.if修改是可能的,否则为什么不允许

问题描述:

   我在c#.i中读到了有关接口和抽象类的信息,有疑问 关于接口和抽象类的修改。

   i read about interfaces and abstract classes in c#.i have doubt  about modification in interfaces and abstract classes.

如果两个概念都可以修改,为什么修改允许,否则为什么不允许修改

if modification is possible in both concepts why modification allowed otherwise why modification is not allowed

" 有疑问 关于界面中的修改  

您必须更加具体。 

You're going to have to be more specific. 

界面是只是两段代码之间的契约,澄清了1件将提供的功能以及另一件可以使用的功能。您不能在不使两段代码无效的情况下更改合同。因此,您通常不会修改接口。

An interface is just a contract between 2 pieces of code that clarifies what functionality 1 piece will provide and what the other can use. You cannot alter a contract without invalidating both pieces of code. As such you generally don't modify interfaces.

抽象类提供了部分实现。派生类可以添加其他功能。抽象类是首选,因为可以添加新功能而不会破坏任何现有代码。也可以进行更改,但可能或
可能会使现有代码无效。

Abstract classes provide a partial implementation of something. Derived classes can add additional functionality. Abstract classes are preferred because new functionality can be added without breaking any existing code. Changes can also be made but may or may invalid existing code.