这是什么意思,在Java中的ArrayList [英] what is this mean in the ArrayList in Java
本文介绍了这是什么意思,在Java中的ArrayList的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Java的新的,我已经看到了这样的一个ArrayList的例子。
I'm new in Java, and I have seen a ArrayList example like this.
listing = new ArrayList<Lot>();
我知道,如果我想创建一个空数组列表。然后,我将使用的ArrayList()
但我不明白什么是&LT;批号&GT;的
中的的ArrayList
和()
But I don't understand what is the <Lot>
between the "ArrayList
" and "()
".
有人能解释一下?
感谢
推荐答案
这是Java的泛型。在&LT;&地段GT;
表示ArrayList中包含的类型地块的唯一对象。因为编译器可以做的类型检查对你的ArrayList是非常有用的。
This is Java Generics. The <Lot>
indicates that the ArrayList will contain only objects of type Lot. It is useful because the compiler can do type checking on your ArrayList.
这篇关于这是什么意思,在Java中的ArrayList的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文