Re: [Vala] Inheritance and construct
- From: Matías De la Puente <mfpuente ar gmail com>
- To: Arley Consuegra Rosello <aconsuegra estudiantes uci cu>
- Cc: vala-list gnome org
- Subject: Re: [Vala] Inheritance and construct
- Date: Mon, 25 May 2009 23:05:43 -0300
Hi Arley,
2009/5/25 Arley Consuegra Rosello
<aconsuegra estudiantes uci cu>
I'm have a problem with de inheritance and the constructors.
In c++ the inheritance loosks like
class padre{
protected:
int a,b,c;
public:
padre(int pa,int pb,int pc){
a=pa;
b=pb;
c=pc;
}
}
This is the definition of Padre that you need:
public class Padre {
protected int a;
protected int b;
protected int c;
public Padre (int pa, int pb, int pc) {
a = pa;
b = pb;
c = pc;
}
}
class hija: public padre{
private:
int d;
public:
hija(int pa,int pb,int pc,int pd):padre(pa,pb,pc){
d=pd;
}
}
And for Hija:
public class Hija: Padre {
private int d;
public Hija (int pa, int pb, int pc, int pd)
{
base (pa, pb, pc);
d = pd;
}
}
The sintax of Vala is derived from C#, so the basic concepts come from C#.
but in Vala I read de examples and don't find how to some thing like this.
_______________________________________________
Vala-list mailing list
Vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list
Matias
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]