Given an ArrayList, and we have to create a sub list from it using Java program.
ArrayList. subList()
It is used to return a sub list (also, consider as List).
Syntax:
ArrayList. subList(start_index, end_index);
start_index, end_index are the indexes for 'from' and 'to' index
The list, returned by ArrayList.subList() will be stored in an object of "List".
 
                                                                     
                            
Consider the program
Output
need an explanation for this answer? contact us directly to get an explanation for this answer