Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Base {
- public Base() {
- InitializeComponent();
- }
- protected virtual void InitializeComponent() {
- ...
- }
- }
- class Derived : Base {
- private Button button1;
- public Derived() : base() {
- button1 = new Button();
- }
- protected override void InitializeComponent() {
- button1.Text = "I'm gonna throw a null reference exception"
- }
- }
- class foo {
- public:
- foo();
- ~foo() { Cleanup() };
- virtual void Cleanup();
- }
- class bar : public foo {
- public:
- bar()
- :foo() {};
- ~bar();
- virtual void Cleanup()
- {
- foo::Cleanup();
- // Do some special bar() related cleanup now...
- }
- }
Add Comment
Please, Sign In to add comment