Answers for "java array list add list"

2

how to add to an arraylist java

import java.util.ArrayList;
public class Details {
    public static void main(String[] args) {

        //ArrayList<String> Declaration
        ArrayList<String> al= new ArrayList<String>();
        //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);
Posted by: Guest on July-14-2020
2

java add a list to a list

List mylist.addAll(secondList);
Posted by: Guest on June-09-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language