Program:
package JavaCoders;import java.util.*;
class ArrayList1
{
public static void main(String[] x)
{
ArrayList<String>ar=new ArrayList<String>();
ArrayList ar1=new ArrayList();
ArrayList ar2=new ArrayList();
ArrayList ar3=new ArrayList();
ar.add("BALWANT");
ar.add("SINGH");
ar1.add("VISIT");
ar1.add("WEBSITE");
ar2.add("JAVACODERS");
ar2.add("LINK IS");
ar3.add("https://wingsofm.blogspot.in/");
ar3.add("YOU CAN FOLLOW ME");
ar.addAll(ar1);
ar.addAll(ar2);
ar.addAll(ar3);
for(String s:ar)
{
System.out.println(s);
}
}
}
OUTPUT:
If You want to Explore more in ArrayList You can go to this link:
https://wingsofm.blogspot.in/2017/05/how-add-method-works-in-arraylist-in.html
This tutorial will tell you about basic features of arraylist and methods for implementing it with good example.
Lucky Club Casino Site » Up to €500 Welcome Bonus!
ReplyDeleteLucky Club offers players a thrilling selection of virtual games. Experience the thrill of casino games with the biggest jackpot prizes of the day, and up to €500 luckyclub.live