以下に各クラスのオブジェクトがあり、IDnumberが両方のマップのキーであるハッシュマップに各オブジェクトを配置するとします。
class1 {
int IDNumber = 123; //same person as class2
String name = John;
String company = Intel;
class2 {
int IDNumber = 123; //same person as class1
int income = 500;
int workYears = 3;
}
HashMap<Integer, class1> one = new Hashmap<Integer, class1>();
HashMap<Integer, class2> two = new HashMap<Integer, class2>();
では、これら2つのHashMapを3番目のHashMapにマッシュアップして、キーID番号と、名前、会社、収入、および労働年の値を取得するにはどうすればよいでしょうか。