java的HOWTO ArrayList的PUSH,POP,移位,和不印字 [英] java howto ArrayList push, pop, shift, and unshift
本文介绍了java的HOWTO ArrayList的PUSH,POP,移位,和不印字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经确定了一个Java ArrayList.add
类似于JavaScript的 Array.push
I've determined that a Java ArrayList.add
is similar to a JavaScript Array.push
我卡上找到的ArrayList
功能类似于以下
I'm stuck on finding ArrayList
functions similar to the following
-
Array.pop
-
Array.shift
-
Array.unshift
我倾向于ArrayList.remove [在]
Array.pop
Array.shift
Array.unshift
I'm leaning towardArrayList.remove[At]
最后一个是什么,我现在在做(安卓)最重要的。感谢您的事先的!
The last one is the most important for what I'm working on now (Android). Thanks in advance!
推荐答案
的ArrayList
是在它的命名标准是唯一的。这里的换算公式:
ArrayList
is unique in its naming standards. Here's the equivalencies:
Array.pop -> ArrayList.remove(int index);
Array.shift -> ArrayList.remove(0);
Array.unshift -> ArrayList.add(int index, Object o); //Index would be 0
这篇关于java的HOWTO ArrayList的PUSH,POP,移位,和不印字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文