The Artima Developer Community
Sponsored Link

.NET Buzz Forum
My Favorite Use of Sealed

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Brad Wilson

Posts: 462
Nickname: dotnetguy
Registered: Jul, 2003

Brad Wilson is CTO of OneVoyce, Inc.
My Favorite Use of Sealed Posted: Jul 24, 2003 10:37 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Brad Wilson.
Original Post: My Favorite Use of Sealed
Feed Title: The .NET Guy
Feed URL: /error.aspx?aspxerrorpath=/dotnetguy/Rss.aspx
Feed Description: A personal blog about technology in general, .NET in specific, and when all else fails, the real world.
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Brad Wilson
Latest Posts From The .NET Guy

Advertisement

Ingo and Clemens are talking about sealed classes today. I'm not going to talk about that. :)

Instead, I'll share the coolest thing I learned about the sealed keyword. It works on virtual methods just like sealing classes. For instance, if you have a class:

public class Foo
{
  protected virtual void Baz() { ... }
}

You can override and seal in a derived class:

public class Bar : Foo
{
  protected override sealed void Baz() { ... }
}

This lets you end the chain of virtual override. Classes that derive from Bar are no longer allowed to override the Baz() method.

Read: My Favorite Use of Sealed

Topic: CGI Problems and Windows Server 2003 Previous Topic   Next Topic Topic: David Bowens Tears ACL

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use