Re: Constructors
- From: "crazy.marc@xxxxxxxxx" <crazy.marc@xxxxxxxxx>
- Date: 28 May 2006 19:25:13 -0700
okay uhm I asked this to a friend of mine, but he only knows C++ and he
understood, and I'll give the example here.
In C++ it would be done as the following :
class test1 {
static int i_1, i_2;
test1(int i, int i2): i_1(i), i_2(i2) { }
}
This means that it will automatically assign the value of i to i_1 and
i2 to i_2 without the code :
class test1 {
static int i_1, i_2;
test1(int i, int i2) {
i_1 = i;
i_2 = i2;
}
}
Is there a way to do this in java?
Hope its worded better
Marc
.
- Follow-Ups:
- Re: Constructors
- From: Oliver Wong
- Re: Constructors
- From: Bjorn Abelli
- Re: Constructors
- References:
- Constructors
- From: crazy.marc@xxxxxxxxx
- Re: Constructors
- From: Allan M. Bruce
- Re: Constructors
- From: crazy.marc@xxxxxxxxx
- Re: Constructors
- From: Allan M. Bruce
- Constructors
- Prev by Date: Re: Constructors
- Next by Date: Open Source OCR for Java/C++
- Previous by thread: Re: Constructors
- Next by thread: Re: Constructors
- Index(es):