ArrayList vs List<object>

前端 未结 6 1578
夕颜
夕颜 2020-11-27 17:43

I saw this reply from Jon on Initialize generic object with unknown type:

If you want a single collection to contain multiple unrelated types of v

6条回答
  •  Happy的楠姐
    2020-11-27 18:22

    List<> is a typesafe version of ArrayList. It will guarantee that you will get the same object type in the collection.

提交回复
热议问题