📜  如何添加到数组列表 java 代码示例

📅  最后修改于: 2022-03-11 14:52:26.413000             🧑  作者: Mango

代码示例2
import java.util.ArrayList;
public class Details {
    public static void main(String[] args) {

        //ArrayList Declaration
        ArrayList al= new ArrayList();
        //add method for String ArrayList
        al.add("Ram");
        al.add("Shyam");
        al.add("CPS");
        al.add("John");
        al.add("Steve");
        System.out.println("Elements of ArrayList of String Type: "+al);