Online Java Compiler By
JavaTpoint.com
import java.util.*; public class CollectionsLastIndexOfSubListExample2 { public static void main(String[] args) { //Create lists for source and destination List
source = Arrays.asList(1,2,3); List
target = Arrays.asList(4,5,6,7,8); //Check target list in source list int index = Collections.lastIndexOfSubList(target, source); System.out.println("Target Output: "+index); } }
Output