composition
From: Andersen (alibandali_at_hotmail.com)
Date: 06/09/04
- Next message: Neo: "Re: Nearest Common Ancestor Report (XDb1's $1000 Challenge)"
- Previous message: Neo: "Re: Nearest Common Ancestor Report (XDb1's $1000 Challenge)"
- Next in thread: CHANGE DOMAIN TO DJA D0T MAILME D0T ORG TO EMAIL: "Re: composition"
- Reply: CHANGE DOMAIN TO DJA D0T MAILME D0T ORG TO EMAIL: "Re: composition"
- Reply: Ilja Preuß: "Re: composition"
- Reply: Daniel T.: "Re: composition"
- Reply: Doc O'Leary: "Re: composition"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 09 Jun 2004 19:33:01 +0200
Hi,
If I have 3 classes, A, B, C where A is a composition of B and C:
class A {
public A(int i, String s) { ... }
}
class B {
public A(int i, String s) { ... }
}
class C {
public A a;
public B b;
}
Which one of these two constructors are generally to be preferred for C:
public C(A varA, B varB);
{
a=varA;
b=varB;
}
or
public C(int x, int y, String i, String J)
{
a=new A(x, i);
b=new B(y, j);
}
Is anyone to be preferred? if so why?
regards,
Andersen
- Next message: Neo: "Re: Nearest Common Ancestor Report (XDb1's $1000 Challenge)"
- Previous message: Neo: "Re: Nearest Common Ancestor Report (XDb1's $1000 Challenge)"
- Next in thread: CHANGE DOMAIN TO DJA D0T MAILME D0T ORG TO EMAIL: "Re: composition"
- Reply: CHANGE DOMAIN TO DJA D0T MAILME D0T ORG TO EMAIL: "Re: composition"
- Reply: Ilja Preuß: "Re: composition"
- Reply: Daniel T.: "Re: composition"
- Reply: Doc O'Leary: "Re: composition"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|