followup to this questionとして、適切な部屋にDogを追加する単一の方法を記述することは可能ですか? (この例では、Animalの部屋またはDogの部屋のいずれかを受け入れます)。または、以下のように2つの異なる方法を強制しますか? (私は型の消去のために過負荷に頼ることさえできません)。 public class Rooms {
interface Animal
は、このコードスニペット //Creates a list of List numbers
List<List<Number>> num = new ArrayList<List<Number>>();
//Creates a list of List doubles
List<List<Double>> doub = new ArrayList<List<Doubl