別のクラスプロパティを動的に継承するドメインクラスコンストラクターを作成しようとしています。しかし、私はそれを正しく動作させることができません。
ここに例があります:
class Example1 {
String name;
String location;
}
class Example2 extends Example1 {
String status;
public Example2 (Example1 orig){
// Code here to set this.name and this.location to name and location from orig
// dynamically, so adding a field in Example1 does not require me to add that
// field here.
}
}