msdn 上的重载含义
我不明白重载术语在 msdn 库的 MemoryStream Close 方法(或其他类似 Dispose 方法)页面的上下文中意味着什么。
请参阅此处页面。 对我来说,重载指出这样一个事实:您提供的方法与现有方法具有相同的名称但签名不同,并且位于同一类中。
在这种情况下,不存在现有的 Close 方法。难道不应该被覆盖吗?谢谢!
I don't understand what does the overloaded term mean in the context of msdn library's page for MemoryStream Close method (or others like Dispose).
See the page here.
To me, overloaded points out the fact that you are providing a method with the same name but different signature than an existing one AND in the same class.
In this case, there's no existing Close method. Shouldn't it be override instead? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗯...它看起来更像是一个 MSDN 故障。据我所知,
MemoryStream
不会覆盖、重载或重新声明(new
)Close()
方法。说实话,不知道 MSDN 在做什么。我想知道这种区别是否仅出于文档目的而存在,因为
MemoryStream
没有非托管资源(实际上底层缓冲区仍然可用)。与
不过,它确实覆盖了
Dispose(bool)
。Hmm... it looks more like an MSDN glitch. From what I can see
MemoryStream
doesn't override, overload or re-declare (new
) theClose()
method. Not sure what MSDN is up to, to be honest.I wonder if this distinction only exists for documentation purposes, because there are no unmanaged resources for a
MemoryStream
(and indeed the underlying buffer is still available).vs
it does override
Dispose(bool)
, though.