java ArrayList contains different objects

前端 未结 5 1290
攒了一身酷
攒了一身酷 2020-12-09 06:28

Is it possible to create ArrayList list = new ArrayList();

I mean add obje

5条回答
  •  攒了一身酷
    2020-12-09 06:46

    Create a class and use polymorphism. And then to pick up the object in the click, use instanceof.

提交回复
热议问题