Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to create Java ArrayList

// welcome to softhunt.net
import java.util.ArrayList;

class Main {
  public static void main(String[] args){

    // create ArrayList
    ArrayList<String> Websites = new ArrayList<>();

    // Add elements to ArrayList
    Websites.add("Softhunt.net");
    Websites.add("Pythonprogramming.com");
    Websites.add("Tutorial.io");
    System.out.println("ArrayList: " + Websites);
  }
}
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #create #Java #ArrayList
ADD COMMENT
Topic
Name
6+5 =