Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

sublist java


            ArrayList<String> arrlist = new ArrayList<String>();
  
            // Populating arrlist1
            arrlist.add("A");
            arrlist.add("B");
            arrlist.add("C");
            arrlist.add("D");
            arrlist.add("E");
  
            // print arrlist
            System.out.println("Original arrlist: "
                               + arrlist);
  
            // getting the subList
            // using subList() method
            List<String> arrlist2 = arrlist.subList(2, 4);
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #sublist #java
ADD COMMENT
Topic
Name
7+3 =