Re: [Vala] how to call the base class constructor
- From: Frederik <scumm_fredo gmx net>
- To: vala-list gnome org
- Subject: Re: [Vala] how to call the base class constructor
- Date: Fri, 08 Aug 2008 17:35:41 +0200
picca wrote:
so how can I call the base constructor and more generaly a Base class
method ?
Hi,
the base constructor gets called implicitly. If you have construction
parameters you have to set them explicitly in the child class:
public class Base : Object {
public string name { private get; construct; }
public Base (string name) {
this.name = name;
}
construct {
// Base construction code
}
}
public class Child : Base {
public Child (string name) {
this.name = name;
}
construct { // base construction code gets called implicitly
// Child construction code
}
}
Regards,
Frederik
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]