Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

array to arraylist convert

  public class Main {
            public static void main(String[] args) {
                String[] array = {"Dog", "Cat", "Horse", "Turtle"};
                ArrayList<String> array1 = new ArrayList<>();
                for (int i = 0; i < array.length; i++) {
                    array1.add(array[i]);
                }
                System.out.println(array1);
            }
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #array #arraylist #convert
ADD COMMENT
Topic
Name
3+5 =