How to find an index of the ArrayList from the starting index in Java?
Advertisements I want to search for an index of the element in the ArrayList but I want to start searching from starting index different than 0. I tried like this: import java.util.*; public class Test{ public static void main(String[] args) { ArrayList<String> bricks = new ArrayList<String>(List.of("BBBB","CCCC","DDDD")); System.out.println(bricks.subList(1, bricks.size()).indexOf("CCCC")); } } Output: 0 Expected output: 1… Read More How to find an index of the ArrayList from the starting index in Java?