本文介绍了Java中std :: vector的等价物?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Java中与std :: vector最接近的是什么?我的意思是,这个类可以将T引入其构造函数,然后是pushBack,popBack(),它存储在连续内存(不是链表)中。
What would be the closest thing to a std::vector in Java? By this I mean, a class which can take in T into its constructor and then pushBack, popBack() and that is stored in continuous memory (not linked list).
谢谢
推荐答案
一切都存储在数组(连续内存)内部,虽然操作名称有点不同。
ArrayList
Everything's stored in array ("continuous memory") internally, although operation names are a bit different.
编辑
帮助方法在他的回答中也提到了有用的课程(虽然不完全等同于C ++ Vector)。
edit
Helper Method also mentioned useful class in his answer (although not exactly equivalent to C++ Vector).
这篇关于Java中std :: vector的等价物?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!