好,你的问题只能是遍历集合了:
假设list2为B的泛型集合
参考代码:
foreach(A a1 in list1){
B b1 = new B()
b1.a=a1.a
//根据bcd不同值给b1中所有字段
b1.e=a1.e
list2.add(b1)
}
String seatname="set"+i+""+jSeat seat
seat= new Seat(Seatsname, "green", 0)
seats.Add(seat.SeatName, seat)
改成 String seatname="set"+i+""+j
seats.Add(SeatName, new Seat(Seatname, "green", 0))
对啦,seat= new Seat(Seatsname, "green", 0)中Seatsname应该是笔误吧,我修改为Seatname
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)