An interface is implemented by either class or struct inheritance. A struct isn't
appropriate in this case: We don't expect to be creating and manipulating lots of Fibonacci objects in time-critical portions of the application. We'll declare Fibonacci as a class then.Because we do not expect it to be subsequently derived from, we'll declare it to be sealed as well:
public sealed class Fibonacci : INumericSequence {}我看了,翻译没有问题,只是理解上有问题,大家说说自己得理解吧
appropriate in this case: We don't expect to be creating and manipulating lots of Fibonacci objects in time-critical portions of the application. We'll declare Fibonacci as a class then.Because we do not expect it to be subsequently derived from, we'll declare it to be sealed as well:
public sealed class Fibonacci : INumericSequence {}我看了,翻译没有问题,只是理解上有问题,大家说说自己得理解吧
所以说在本例(Fibonacci数),class 比 struce 效率要高。
还是不太明白,请明示to cysoft:
管闲是理解,翻译都差不多