Set of variable length Java - ArrayList class
Blog Description
Information in the article involved from the Internet and organize personal conclusion, meaning that the individual learning experience and summary, what if infringement, please contact me to delete, thank you!
Explanation
ArrayList is an implementation of the collection, implements the interface List, List interface extends the Collection interface. Collection is the parent class of all collections
usage
//创建
ArrayList<String> list = new ArrayList<>();
Common method
add,addAll,set,get,remove,size,isEmpty等
add (E element) added
list.add('小明');
set (int index, E element) inserted
list.set(3,'小花');
get (int index) Gets
list.get(1);
remove (int index) Delete
list.remove(1);
thank
Baidu Encyclopedia
Universal Network
And a hardworking own