Re: Calling the base class constructor
From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 05/25/04
- Next message: Jon Skeet [C# MVP]: "RE: High speed string processing"
- Previous message: JezB: "Re: Loop thru Assemblies"
- In reply to: Jo Vermeulen: "Calling the base class constructor"
- Next in thread: Jo Vermeulen: "Re: Calling the base class constructor"
- Reply: Jo Vermeulen: "Re: Calling the base class constructor"
- Reply: cody: "Re: Calling the base class constructor"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 25 May 2004 13:06:43 +0100
Jo Vermeulen <jo@lumumba.luc.ac.be> wrote:
> I was wondering how I could call the base class constructor from a derived
> class constructor. In Java I could do something like
>
> super(parameter);
>
> I tried
>
> base(parameter);
>
> in C# but it doesn't compile. Any ideas?
You do base (parameter) but in a different place:
public Derived() : base (...)
{
}
See http://www.pobox.com/~skeet/csharp/constructors.html for more
information.
-- Jon Skeet - <skeet@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
- Next message: Jon Skeet [C# MVP]: "RE: High speed string processing"
- Previous message: JezB: "Re: Loop thru Assemblies"
- In reply to: Jo Vermeulen: "Calling the base class constructor"
- Next in thread: Jo Vermeulen: "Re: Calling the base class constructor"
- Reply: Jo Vermeulen: "Re: Calling the base class constructor"
- Reply: cody: "Re: Calling the base class constructor"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|