How are Java generics different from C++ templates? Why can't I use int as a parameter?

后端 未结 8 1370
眼角桃花
眼角桃花 2020-12-12 19:02

I am trying to create

ArrayList myList = new ArrayList();

in Java but that does not work.

Can someone explain

8条回答
  •  温柔的废话
    2020-12-12 19:44

    You could try TIntArraList from GNU Trove which will act like an ArrayList of int values.

提交回复
热议问题