What is wrong here? I get a java.lang.ClassCastException error but I can't see where I have gone wrong

后端 未结 2 1115
遇见更好的自我
遇见更好的自我 2021-01-25 09:50

This is the first time I have really used Lists and Queues so this might be a very simple mistake. Is it because my queue is full of objects that can\'t be cast to integers?

2条回答
  •  广开言路
    2021-01-25 10:16

    You really should use Generics and ArrayList/ArrayDeque unless it's really performance critical and you use a lot of atomic types like int. Then you should have a look at http://labs.carrotsearch.com/hppc.html

提交回复
热议问题